|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.python.core.io.IOBase
org.python.core.io.TextIOBase
public abstract class TextIOBase
Base class for text I/O. This class provides a character and line based interface to stream I/O.
| Field Summary | |
|---|---|
static int |
CHUNK_SIZE
The size of chunks read for readline |
| Fields inherited from class org.python.core.io.IOBase |
|---|
DEFAULT_BUFFER_SIZE |
| Constructor Summary | |
|---|---|
TextIOBase(BufferedIOBase bufferedIO)
Contruct a TextIOBase wrapping the given BufferedIOBase. |
|
| Method Summary | |
|---|---|
InputStream |
asInputStream()
Coerce this into an InputStream if possible, or return null. |
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. |
PyObject |
getNewlines()
Return the known Newline types, as a PyObject, encountered while reading this file. |
boolean |
isatty()
Returns whether this is an 'interactive' stream. |
String |
read(int size)
Read and return up to size bytes, contained in a String. |
boolean |
readable()
Return whether this file was opened for reading. |
String |
readall()
Read until EOF. |
int |
readinto(PyObject buf)
Read into the given PyObject that implements the read-write buffer interface (currently just a PyArray). |
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: 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. |
long |
truncate(long pos)
Truncate file to size in bytes. |
boolean |
writable()
Return whether this file was opened for writing. |
int |
write(String buf)
Write the given String to the IO stream. |
| Methods inherited from class org.python.core.io.IOBase |
|---|
checkClosed, checkReadable, checkWritable, seek |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CHUNK_SIZE
| Constructor Detail |
|---|
public TextIOBase(BufferedIOBase bufferedIO)
bufferedIO - a BufferedIOBase to wrap| Method Detail |
|---|
public String read(int size)
size - the number of bytes to read
public String readall()
public String readline(int size)
size - the number of bytes to read
public int readinto(PyObject buf)
buf - a PyObject implementing the read-write buffer interface
public int write(String buf)
buf - a String value
public long truncate(long pos)
IOBase
truncate in class IOBasepos - a long size to truncate to
public void flush()
IOBase
flush in class IOBasepublic void close()
IOBase
close in class IOBase
public long seek(long pos,
int whence)
IOBase
seek in class IOBasepos - a long position valuewhence - an int whence value
public long tell()
IOBase
tell in class IOBasepublic RawIOBase fileno()
IOBase
fileno in class IOBasepublic boolean isatty()
IOBase
isatty in class IOBasepublic boolean readable()
IOBase
readable in class IOBasepublic boolean writable()
IOBase
writable in class IOBasepublic boolean closed()
IOBase
closed in class IOBasepublic InputStream asInputStream()
IOBase
asInputStream in class IOBasepublic OutputStream asOutputStream()
IOBase
asOutputStream in class IOBasepublic PyObject getNewlines()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||