Class UnsafeChunkEncoder

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    UnsafeChunkEncoderBE, UnsafeChunkEncoderLE

    public abstract class UnsafeChunkEncoder
    extends ChunkEncoder
    ChunkEncoder implementation that handles actual encoding of individual chunks, using Sun's sun.misc.Unsafe functionality, which gives nice extra boost for speed.
    • Field Detail

      • unsafe

        static final sun.misc.Unsafe unsafe
      • BYTE_ARRAY_OFFSET

        static final long BYTE_ARRAY_OFFSET
    • Constructor Detail

      • UnsafeChunkEncoder

        UnsafeChunkEncoder​(int totalLength)
      • UnsafeChunkEncoder

        UnsafeChunkEncoder​(int totalLength,
                           boolean bogus)
      • UnsafeChunkEncoder

        UnsafeChunkEncoder​(int totalLength,
                           BufferRecycler bufferRecycler)
      • UnsafeChunkEncoder

        UnsafeChunkEncoder​(int totalLength,
                           BufferRecycler bufferRecycler,
                           boolean bogus)
    • Method Detail

      • _checkArrayIndices

        static void _checkArrayIndices​(byte[] array,
                                       int start,
                                       int end)
        Parameters:
        start - start index, inclusive
        end - end index, exclusive
      • _checkOutputLength

        static void _checkOutputLength​(int inputLen,
                                       int outputLen)
      • _copyPartialLiterals

        static final int _copyPartialLiterals​(byte[] in,
                                              int inPos,
                                              byte[] out,
                                              int outPos,
                                              int literals)
      • _copyLongLiterals

        static final int _copyLongLiterals​(byte[] in,
                                           int inPos,
                                           byte[] out,
                                           int outPos,
                                           int literals)
      • _copyFullLiterals

        static final int _copyFullLiterals​(byte[] in,
                                           int inPos,
                                           byte[] out,
                                           int outPos)
      • _handleTail

        static final int _handleTail​(byte[] in,
                                     int inPos,
                                     int inEnd,
                                     byte[] out,
                                     int outPos,
                                     int literals)
      • _findTailMatchLength

        static final int _findTailMatchLength​(byte[] in,
                                              int ptr1,
                                              int ptr2,
                                              int maxPtr1)