Class VanillaChunkDecoder


  • public class VanillaChunkDecoder
    extends ChunkDecoder
    Safe ChunkDecoder implementation that can be used on any platform.
    • Constructor Detail

      • VanillaChunkDecoder

        public VanillaChunkDecoder()
    • Method Detail

      • decodeChunk

        public final int decodeChunk​(java.io.InputStream is,
                                     byte[] inputBuffer,
                                     byte[] outputBuffer)
                              throws java.io.IOException
        Description copied from class: ChunkDecoder
        Main decode from a stream. Decompressed bytes are placed in the outputBuffer, inputBuffer is a "scratch-area".
        Specified by:
        decodeChunk in class ChunkDecoder
        Parameters:
        is - An input stream of LZF compressed bytes
        inputBuffer - A byte array used as a scratch area.
        outputBuffer - A byte array in which the result is returned
        Returns:
        The number of bytes placed in the outputBuffer.
        Throws:
        java.io.IOException
      • skipOrDecodeChunk

        public int skipOrDecodeChunk​(java.io.InputStream is,
                                     byte[] inputBuffer,
                                     byte[] outputBuffer,
                                     long maxToSkip)
                              throws java.io.IOException
        Specified by:
        skipOrDecodeChunk in class ChunkDecoder
        Returns:
        If positive number, number of bytes skipped; if -1, end-of-stream was reached; otherwise, amount of content decoded (using formula of returnValue = -(decodedAmount + 2))
        Throws:
        java.io.IOException
      • copyUpTo32WithSwitch

        protected static final void copyUpTo32WithSwitch​(byte[] in,
                                                         int inPos,
                                                         byte[] out,
                                                         int outPos,
                                                         int lengthMinusOne)