public class BufferedReader extends BufferedIOMixin
DEFAULT_BUFFER_SIZE| Constructor and Description |
|---|
BufferedReader(RawIOBase rawIO,
int bufferSize)
Construct a BufferedReader of bufferSize, wrapping the given
RawIOBase.
|
| 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.
|
java.nio.ByteBuffer |
peek(int size)
Returns buffered bytes without advancing the position.
|
int |
read1(java.nio.ByteBuffer bytes)
Reads up to bytes.remaining() bytes.
|
java.nio.ByteBuffer |
readall()
Read until EOF.
|
int |
readinto(java.nio.ByteBuffer bytes)
Read up to bytes.remaining() bytes into the given ByteBuffer.
|
long |
seek(long pos,
int whence)
Seek to byte offset
pos relative to position indicated by whence. |
long |
tell()
Return the current stream position.
|
boolean |
writable()
Return whether this file was opened for writing.
|
int |
write(java.nio.ByteBuffer bytes)
Write the given ByteBuffer to the IO stream.
|
asInputStream, asOutputStream, close, closed, fileno, flush, isatty, readable, truncatereadcheckClosed, checkReadable, checkWritable, seekpublic BufferedReader(RawIOBase rawIO, int bufferSize)
rawIO - bufferSize - public int readinto(java.nio.ByteBuffer bytes)
BufferedIOBasereadinto in class BufferedIOBasebytes - a ByteBuffer to read bytes intopublic java.nio.ByteBuffer readall()
BufferedIOBasereadall in class BufferedIOBasepublic java.nio.ByteBuffer peek(int size)
BufferedIOBasepeek in class BufferedIOBasesize - the minimal number of bytes as an intpublic int read1(java.nio.ByteBuffer bytes)
BufferedIOBaseread1 in class BufferedIOBasebytes - a ByteBuffer to read bytes intopublic long tell()
IOBasetell in class BufferedIOMixinpublic long seek(long pos,
int whence)
IOBasepos relative to position indicated by whence.
whence |
Seek to | pos |
|---|---|---|
| 0 | Start of stream (the default). | Should be ≥0. |
| 1 | Current position + pos | Either sign. |
| 2 | End of stream + pos | Usually ≤0. |
seek in class BufferedIOMixinpos - a long position valuewhence - an int whence valuepublic boolean buffered()
BufferedIOBasebuffered in class BufferedIOBasepublic void clear()
BufferedIOBaseclear in class BufferedIOBasepublic int write(java.nio.ByteBuffer bytes)
BufferedIOBasewrite in class BufferedIOBasebytes - a ByteBuffer valuepublic boolean writable()
IOBasewritable in class BufferedIOMixin