Class ByteBufferInputStream

    • Constructor Detail

      • ByteBufferInputStream

        public ByteBufferInputStream​(ByteBuffer byteBuffer)
    • Method Detail

      • setByteBuffer

        public void setByteBuffer​(ByteBuffer byteBuffer)
        Set the wrapped ByteBuffer
        Parameters:
        byteBuffer - The wrapped byteBuffer
      • available

        public int available()
        Return the available bytes
        Overrides:
        available in class InputStream
        Returns:
        the wrapped byteBuffer.remaining()
      • markSupported

        public boolean markSupported()
        Return true if mark is supported.
        Overrides:
        markSupported in class InputStream
      • read

        public int read()
        Read the first byte from the wrapped ByteBuffer.
        Specified by:
        read in class InputStream
      • read

        public int read​(byte[] b)
        Read the bytes from the wrapped ByteBuffer.
        Overrides:
        read in class InputStream
      • read

        public int read​(byte[] b,
                        int offset,
                        int length)
        Read the first byte of the wrapped ByteBuffer.
        Overrides:
        read in class InputStream