public class UniversalIOWrapper extends TextIOBase
CHUNK_SIZE
DEFAULT_BUFFER_SIZE
Constructor and Description |
---|
UniversalIOWrapper(BufferedIOBase bufferedIO)
Contruct a UniversalIOWrapper wrapping the given
BufferedIOBase.
|
Modifier and Type | Method and Description |
---|---|
PyObject |
getNewlines()
Return the known Newline types, as a PyObject, encountered
while reading this file.
|
java.lang.String |
read(int size)
Read and return up to size bytes, contained in a String.
|
java.lang.String |
readall()
Read until EOF.
|
java.lang.String |
readline(int size)
Read until size, newline or EOF.
|
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.lang.String buf)
Write the given String to the IO stream.
|
asInputStream, asOutputStream, close, closed, fileno, flush, isatty, readable, readinto, truncate, writable
checkClosed, checkReadable, checkWritable, seek
public UniversalIOWrapper(BufferedIOBase bufferedIO)
bufferedIO
- public java.lang.String read(int size)
TextIOBase
read
in class TextIOBase
size
- the number of bytes to readpublic java.lang.String readall()
TextIOBase
readall
in class TextIOBase
public java.lang.String readline(int size)
TextIOBase
readline
in class TextIOBase
size
- the number of bytes to readpublic int write(java.lang.String buf)
TextIOBase
write
in class TextIOBase
buf
- a String valuepublic 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 TextIOBase
pos
- a long position valuewhence
- an int whence valuepublic long tell()
IOBase
tell
in class TextIOBase
public PyObject getNewlines()
TextIOBase
getNewlines
in class TextIOBase