public class BufferedWriter extends BufferedIOMixin
DEFAULT_BUFFER_SIZE
Constructor and Description |
---|
BufferedWriter(RawIOBase rawIO,
int bufferSize)
Construct a BufferedWriter of bufferSize, wrapping the given
RawIOBase.
|
Modifier and Type | Method and Description |
---|---|
boolean |
buffered()
Return true if this objects buffer contains any data.
|
void |
flush()
Flushes write buffers, if applicable.
|
int |
read1(java.nio.ByteBuffer bytes)
Reads up to bytes.remaining() bytes.
|
boolean |
readable()
Return whether this file was opened for reading.
|
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.
|
int |
write(java.nio.ByteBuffer bytes)
Write the given ByteBuffer to the IO stream.
|
asInputStream, asOutputStream, close, closed, fileno, isatty, truncate, writable
clear, peek, read
checkClosed, checkReadable, checkWritable, seek
public BufferedWriter(RawIOBase rawIO, int bufferSize)
rawIO
- bufferSize
- public int write(java.nio.ByteBuffer bytes)
BufferedIOBase
write
in class BufferedIOBase
bytes
- a ByteBuffer valuepublic void flush()
IOBase
flush
in class BufferedIOMixin
public long tell()
IOBase
tell
in class BufferedIOMixin
public long seek(long pos, int whence)
IOBase
pos
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 BufferedIOMixin
pos
- a long position valuewhence
- an int whence valuepublic boolean buffered()
BufferedIOBase
buffered
in class BufferedIOBase
public java.nio.ByteBuffer readall()
BufferedIOBase
readall
in class BufferedIOBase
public int readinto(java.nio.ByteBuffer bytes)
BufferedIOBase
readinto
in class BufferedIOBase
bytes
- a ByteBuffer to read bytes intopublic int read1(java.nio.ByteBuffer bytes)
BufferedIOBase
read1
in class BufferedIOBase
bytes
- a ByteBuffer to read bytes intopublic boolean readable()
IOBase
readable
in class BufferedIOMixin