|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.python.core.io.IOBase
public abstract class IOBase
Base class for all I/O classes. IOBase and its descendents in org.python.core.io are based off Python 3's new io module (PEP 3116). This does not define read(), readinto() and write(), nor readline() and friends, since their signatures vary per layer.
Field Summary | |
---|---|
static int |
DEFAULT_BUFFER_SIZE
The default size of generic buffers |
Constructor Summary | |
---|---|
IOBase()
|
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 |
checkClosed()
Raise a ValueError if the file is closed. |
void |
checkReadable()
Raise an IOError if the file is not readable. |
void |
checkWritable()
Raise an IOError if the file is not writable. |
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)
Seek to byte offset pos relative to the start of the stream. |
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 size)
Truncate file to size in bytes. |
boolean |
writable()
Return whether this file was opened for writing. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_BUFFER_SIZE
Constructor Detail |
---|
public IOBase()
Method Detail |
---|
public long seek(long pos)
pos
- a long position value
public long seek(long pos, int whence)
pos
- a long position valuewhence
- an int whence value
public long tell()
public long truncate(long size)
size
- a long size to truncate to
public void flush()
public void close()
public RawIOBase fileno()
public boolean isatty()
public boolean readable()
public void checkReadable()
public boolean writable()
public void checkWritable()
public boolean closed()
public void checkClosed()
public OutputStream asOutputStream()
public InputStream asInputStream()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |