public abstract class BufferedIOMixin extends BufferedIOBase
DEFAULT_BUFFER_SIZE
Constructor and Description |
---|
BufferedIOMixin(RawIOBase rawIO)
Initialize this buffer, wrapping the given RawIOBase.
|
BufferedIOMixin(RawIOBase rawIO,
int bufferSize)
Initialize this buffer, wrapping the given RawIOBase.
|
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
asInputStream()
Coerce this into an InputStream if possible, or return null.
|
java.io.OutputStream |
asOutputStream()
Coerce this into an OutputStream if possible, or return null.
|
void |
close()
Flushes and closes the IO object.
|
boolean |
closed()
Return whether this file has been closed.
|
RawIOBase |
fileno()
Returns underlying file descriptor if one exists.
|
void |
flush()
Flushes write buffers, if applicable.
|
boolean |
isatty()
Returns whether this is an 'interactive' stream.
|
boolean |
readable()
Return whether this file was opened for reading.
|
long |
seek(long pos,
int whence)
Seek to byte offset
pos relative to position indicated by whence . |
long |
tell()
Return the current stream position.
|
long |
truncate(long size)
Truncate file to size in bytes.
|
boolean |
writable()
Return whether this file was opened for writing.
|
buffered, clear, peek, read, read1, readall, readinto, write
checkClosed, checkReadable, checkWritable, seek
public BufferedIOMixin(RawIOBase rawIO)
rawIO
- a RawIOBase to wrappublic BufferedIOMixin(RawIOBase rawIO, int bufferSize)
rawIO
- a RawIOBase to wrapbufferSize
- the size of the bufferpublic 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. |
public long tell()
IOBase
public long truncate(long size)
IOBase
public void flush()
IOBase
public void close()
IOBase
public RawIOBase fileno()
IOBase
public boolean isatty()
IOBase
public boolean readable()
IOBase
public boolean writable()
IOBase
public boolean closed()
IOBase
public java.io.InputStream asInputStream()
IOBase
asInputStream
in class IOBase
public java.io.OutputStream asOutputStream()
IOBase
asOutputStream
in class IOBase