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
Stream wrapper around a
ByteBuffer-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturn the available bytesvoidclose()Close this stream.booleanReturn 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 wrappedByteBufferMethods inherited from class java.io.InputStream
mark, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
Constructor Details
-
ByteBufferInputStream
-
-
Method Details
-
setByteBuffer
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
-