Methods Summary |
---|
public int | available()Return the available bytes
return byteBuffer.remaining();
|
public void | close()Close this stream.
|
public boolean | markSupported()Return true if mark is supported.
return false;
|
public int | read()Read the first byte from the wrapped ByteBuffer .
if (!byteBuffer.hasRemaining()){
return -1;
}
return (byteBuffer.get() & 0xff);
|
public int | read(byte[] b)Read the bytes from the wrapped ByteBuffer .
return (read(b, 0, b.length));
|
public int | read(byte[] b, int offset, int length)Read the first byte of the wrapped ByteBuffer .
if (!byteBuffer.hasRemaining()) {
return -1;
}
if (length > available()) {
length = available();
}
byteBuffer.get(b, offset, length);
return length;
|
public void | setByteBuffer(java.nio.ByteBuffer byteBuffer)Set the wrapped ByteBuffer
this.byteBuffer = byteBuffer;
|