Class AbstractReadableBuffer

    • Constructor Detail

      • AbstractReadableBuffer

        public AbstractReadableBuffer()
    • Method Detail

      • readInt

        public final int readInt()
        Description copied from interface: ReadableBuffer
        Reads a 4-byte signed integer from this buffer using big-endian byte ordering. Increments the read position by 4.
        Specified by:
        readInt in interface ReadableBuffer
      • hasArray

        public boolean hasArray()
        Description copied from interface: ReadableBuffer
        Indicates whether or not this buffer exposes a backing array.
        Specified by:
        hasArray in interface ReadableBuffer
      • mark

        public void mark()
        Description copied from interface: ReadableBuffer
        Marks the current position in this buffer. A subsequent call to the ReadableBuffer.reset() method repositions this stream at the last marked position so that subsequent reads re-read the same bytes.
        Specified by:
        mark in interface ReadableBuffer
      • getByteBuffer

        public java.nio.ByteBuffer getByteBuffer()
        Description copied from interface: ReadableBuffer
        Gets a ByteBuffer that contains some bytes of the content next to be read, or null if this buffer has been exhausted. The number of bytes contained in the returned buffer is implementation specific. The position of this buffer is unchanged after calling this method. The returned buffer's content should not be modified, but the position, limit, and mark may be changed. Operations for changing the position, limit, and mark of the returned buffer does not affect the position, limit, and mark of this buffer. Buffers returned by this method have independent position, limit and mark. This is an optional method, so callers should first check ReadableBuffer.byteBufferSupported().
        Specified by:
        getByteBuffer in interface ReadableBuffer
      • close

        public void close()
        Description copied from interface: ReadableBuffer
        Closes this buffer and releases any resources.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface ReadableBuffer
      • checkReadable

        protected final void checkReadable​(int length)