Package com.sun.xml.ws.transport.tcp.io
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 aByteBuffer
-
-
Constructor Summary
Constructors Constructor Description ByteBufferInputStream(ByteBuffer byteBuffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
Return the available bytesvoid
close()
Close this stream.boolean
markSupported()
Return true if mark is supported.int
read()
Read the first byte from the wrappedByteBuffer
.int
read(byte[] b)
Read the bytes from the wrappedByteBuffer
.int
read(byte[] b, int offset, int length)
Read the first byte of the wrappedByteBuffer
.void
setByteBuffer(ByteBuffer byteBuffer)
Set the wrappedByteBuffer
-
Methods inherited from class java.io.InputStream
mark, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
ByteBufferInputStream
public ByteBufferInputStream(ByteBuffer byteBuffer)
-
-
Method Detail
-
setByteBuffer
public void setByteBuffer(ByteBuffer byteBuffer)
Set the wrappedByteBuffer
- Parameters:
byteBuffer
- The wrapped byteBuffer
-
available
public int available()
Return the available bytes- Overrides:
available
in classInputStream
- Returns:
- the wrapped byteBuffer.remaining()
-
close
public void close()
Close this stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
-
markSupported
public boolean markSupported()
Return true if mark is supported.- Overrides:
markSupported
in classInputStream
-
read
public int read()
Read the first byte from the wrappedByteBuffer
.- Specified by:
read
in classInputStream
-
read
public int read(byte[] b)
Read the bytes from the wrappedByteBuffer
.- Overrides:
read
in classInputStream
-
read
public int read(byte[] b, int offset, int length)
Read the first byte of the wrappedByteBuffer
.- Overrides:
read
in classInputStream
-
-