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

        protected static final sun.misc.Unsafe unsafe
      • BYTE_ARRAY_OFFSET

        protected static final long BYTE_ARRAY_OFFSET
      • BYTE_ARRAY_OFFSET_PLUS2

        protected static final long BYTE_ARRAY_OFFSET_PLUS2
    • Constructor Detail

      • UnsafeChunkEncoder

        public UnsafeChunkEncoder​(int totalLength)
      • UnsafeChunkEncoder

        public UnsafeChunkEncoder​(int totalLength,
                                  boolean bogus)
      • UnsafeChunkEncoder

        public UnsafeChunkEncoder​(int totalLength,
                                  BufferRecycler bufferRecycler)
      • UnsafeChunkEncoder

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

      • _copyPartialLiterals

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

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

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

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

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