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.
|
ByteBuffer |
peek(int size)
Returns buffered bytes without advancing the position.
|
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.
|
long |
seek(long pos,
int whence)
Seek to byte offset pos relative to position indicated by whence: 0 Start of stream (the
default). pos should be >= 0; 1 Current position - whence may be negative; 2 End of stream -
whence usually negative.
|
long |
tell()
Return the current stream position.
|
boolean |
writable()
Return whether this file was opened for writing.
|
int |
write(ByteBuffer bytes)
Write the given ByteBuffer to the IO stream.
|
asInputStream, asOutputStream, close, closed, fileno, flush, isatty, readable, truncate
read
checkClosed, checkReadable, checkWritable, seek
public BufferedReader(RawIOBase rawIO, int bufferSize)
rawIO
- bufferSize
- public int readinto(ByteBuffer bytes)
BufferedIOBase
readinto
in class BufferedIOBase
bytes
- a ByteBuffer to read bytes intopublic ByteBuffer readall()
BufferedIOBase
readall
in class BufferedIOBase
public ByteBuffer peek(int size)
BufferedIOBase
peek
in class BufferedIOBase
size
- the minimal number of bytes as an intpublic int read1(ByteBuffer bytes)
BufferedIOBase
read1
in class BufferedIOBase
bytes
- a ByteBuffer to read bytes intopublic long tell()
IOBase
tell
in class BufferedIOMixin
public long seek(long pos, int whence)
IOBase
seek
in class BufferedIOMixin
pos
- a long position valuewhence
- an int whence valuepublic boolean buffered()
BufferedIOBase
buffered
in class BufferedIOBase
public void clear()
BufferedIOBase
clear
in class BufferedIOBase
public int write(ByteBuffer bytes)
BufferedIOBase
write
in class BufferedIOBase
bytes
- a ByteBuffer valuepublic boolean writable()
IOBase
writable
in class BufferedIOMixin