Class ByteBufferImpl

  • All Implemented Interfaces:
    ByteBuffer

    public class ByteBufferImpl
    extends Object
    implements ByteBuffer
    A byte buffer that exposes the internal byte array with minimal copying
    Since:
    4.0
    Author:
    (various)
    • Field Detail

    • Method Detail

      • create

        public static ByteBufferImpl create​(byte[] array,
                                            int offset,
                                            int length)
      • getBuf

        public byte[] getBuf()
        Description copied from interface: ByteBuffer
        Returns the underlying buffer.
        Specified by:
        getBuf in interface ByteBuffer
      • getOffset

        public int getOffset()
        Description copied from interface: ByteBuffer
        Returns the offset within the underlying byte[] (as returned by ByteBuffer.getBuf() owned by this buffer instance.
        Specified by:
        getOffset in interface ByteBuffer
      • getLength

        public int getLength()
        Description copied from interface: ByteBuffer
        Length bytes, starting from offset, within the underlying byte[] (as returned by ByteBuffer.getBuf() are owned by this buffer instance.
        Specified by:
        getLength in interface ByteBuffer
      • toString

        public String toString()
      • equals

        public boolean equals​(Object o)
      • hashCode

        public int hashCode()
      • getStream

        public InputStream getStream()
        Returns:
        an input stream for the bytes in the buffer
      • toJDKByteBuffer

        public ByteBuffer toJDKByteBuffer()