override fun shouldSkipContent()

in plot-api/src/commonMain/kotlin/org/jetbrains/letsPlot/util/pngj/ChunkSeqReaderPng.kt [89:105]


    override fun shouldSkipContent(len: Int, id: String): Boolean {
        if (super.shouldSkipContent(len, id)) return true
        if (maxTotalBytesRead > 0 && len + bytesCount > maxTotalBytesRead) throw PngjInputException(
            "Maximum total bytes to read exceeeded: " + maxTotalBytesRead + " offset:"
                    + bytesCount + " len=" + len
        )
        if (chunksToSkip.contains(id)) return true // specific skip
        if (ChunkHelper.isCritical(id)) return false // critical chunks are never skipped
        if (skipChunkMaxSize in 1 until len) return true // too big chunk
        if (maxBytesMetadata > 0 && len > maxBytesMetadata - bytesChunksLoaded) return true // too much ancillary chunks loaded
        when (chunkLoadBehaviour) {
            ChunkLoadBehaviour.LOAD_CHUNK_IF_SAFE -> if (!ChunkHelper.isSafeToCopy(id)) return true
            ChunkLoadBehaviour.LOAD_CHUNK_NEVER -> return true
            else -> {}
        }
        return false
    }