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 intavailable()Return the available bytesvoidclose()Close this stream.booleanmarkSupported()Return true if mark is supported.intread()Read the first byte from the wrappedByteBuffer.intread(byte[] b)Read the bytes from the wrappedByteBuffer.intread(byte[] b, int offset, int length)Read the first byte of the wrappedByteBuffer.voidsetByteBuffer(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:
availablein classInputStream- Returns:
- the wrapped byteBuffer.remaining()
-
close
public void close()
Close this stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream
-
markSupported
public boolean markSupported()
Return true if mark is supported.- Overrides:
markSupportedin classInputStream
-
read
public int read()
Read the first byte from the wrappedByteBuffer.- Specified by:
readin classInputStream
-
read
public int read(byte[] b)
Read the bytes from the wrappedByteBuffer.- Overrides:
readin classInputStream
-
read
public int read(byte[] b, int offset, int length)Read the first byte of the wrappedByteBuffer.- Overrides:
readin classInputStream
-
-