Class ByteBufferInputStream

java.lang.Object
java.io.InputStream
com.sun.xml.ws.transport.tcp.io.ByteBufferInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class ByteBufferInputStream extends InputStream
Stream wrapper around a ByteBuffer
  • Constructor Details

    • ByteBufferInputStream

      public ByteBufferInputStream(ByteBuffer byteBuffer)
  • Method Details

    • 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()
    • close

      public void close()
      Close this stream.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class InputStream
    • 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