public abstract class BufferedIOBase extends IOBase
DEFAULT_BUFFER_SIZE
Constructor and Description |
---|
BufferedIOBase() |
Modifier and Type | Method and Description |
---|---|
boolean |
buffered()
Return true if this objects buffer contains any data.
|
void |
clear()
Clear the read buffer if one exists.
|
ByteBuffer |
peek(int size)
Returns buffered bytes without advancing the position.
|
ByteBuffer |
read(int size)
Read and return up to size bytes, contained in a ByteBuffer.
|
int |
read1(ByteBuffer bytes)
Reads up to bytes.remaining() bytes.
|
ByteBuffer |
readall()
Read until EOF.
|
int |
readinto(ByteBuffer bytes)
Read up to bytes.remaining() bytes into the given ByteBuffer.
|
int |
write(ByteBuffer bytes)
Write the given ByteBuffer to the IO stream.
|
asInputStream, asOutputStream, checkClosed, checkReadable, checkWritable, close, closed, fileno, flush, isatty, readable, seek, seek, tell, truncate, writable
public ByteBuffer read(int size)
size
- the number of bytes to readpublic ByteBuffer readall()
public int readinto(ByteBuffer bytes)
bytes
- a ByteBuffer to read bytes intopublic int write(ByteBuffer bytes)
bytes
- a ByteBuffer valuepublic ByteBuffer peek(int size)
size
- the minimal number of bytes as an intpublic int read1(ByteBuffer bytes)
bytes
- a ByteBuffer to read bytes intopublic boolean buffered()
public void clear()