| Modifier and Type | Field and Description |
|---|---|
| private boolean | closed
true if the file has been closed |
| public static final int | DEFAULT_BUFFER_SIZE
The default size of generic buffers |
| protected static final byte | LF_BYTE
Byte representation of the Line Feed character |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public InputStream | |
| public OutputStream | |
| public void | |
| public void | |
| public void | |
| public void | |
| public boolean | |
| public RawIOBase | |
| public void | |
| public boolean | Returns: a boolean, true if an 'interactive' streamReturns whether this is an 'interactive' stream. |
| public boolean | Returns: true if the file was opened for readingReturn whether this file was opened for reading. |
| public long | Returns: a long position value seeked toa long position value pos)Seek to byte offset pos relative to the start of the stream. |
| public long | Returns: a long position value seeked toa long position value pos, int an int whence value whence)Seek to byte offset |
| public long | |
| public long | Returns: a long size value the file was truncated toa long size to truncate to size)Truncate file to size in bytes. |
| protected void | unsupported(String
the String name of the operation methodName)Raise a TypeError indicating the specified operation is not supported. |
| public boolean | Returns: true if the file was opened for writingReturn whether this file was opened for writing. |
| closed | back to summary |
|---|---|
| private boolean closed true if the file has been closed | |
| DEFAULT_BUFFER_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_BUFFER_SIZE The default size of generic buffers | |
| LF_BYTE | back to summary |
|---|---|
| protected static final byte LF_BYTE Byte representation of the Line Feed character | |
| IOBase | back to summary |
|---|---|
| public IOBase() | |
| asInputStream | back to summary |
|---|---|
| public InputStream asInputStream() Coerce this into an InputStream if possible, or return null. | |
| asOutputStream | back to summary |
|---|---|
| public OutputStream asOutputStream() Coerce this into an OutputStream if possible, or return null. | |
| checkClosed | back to summary |
|---|---|
| public void checkClosed() Raise a ValueError if the file is closed. | |
| checkReadable | back to summary |
|---|---|
| public void checkReadable() Raise an IOError if the file is not readable. | |
| checkWritable | back to summary |
|---|---|
| public void checkWritable() Raise an IOError if the file is not writable. | |
| close | back to summary |
|---|---|
| public void close() Flushes and closes the IO object. This must be idempotent. It should also set a flag for the 'closed' property (see below) to test. | |
| closed | back to summary |
|---|---|
| public boolean closed() Return whether this file has been closed.
| |
| fileno | back to summary |
|---|---|
| public RawIOBase fileno() Returns underlying file descriptor if one exists. Raises IOError if the IO object does not use a file descriptor.
| |
| flush | back to summary |
|---|---|
| public void flush() Flushes write buffers, if applicable. This is a no-op for read-only and non-blocking streams. | |
| isatty | back to summary |
|---|---|
| public boolean isatty() Returns whether this is an 'interactive' stream. Returns False if we don't know.
| |
| readable | back to summary |
|---|---|
| public boolean readable() Return whether this file was opened for reading.
| |
| seek | back to summary |
|---|---|
| public long seek(long pos) Seek to byte offset pos relative to the start of the stream. Returns the new absolute position.
| |
| seek | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public long seek(long pos, int whence) Seek to byte offset
a long position value seeked to | |||||||||||||
| tell | back to summary |
|---|---|
| public long tell() Return the current stream position.
| |
| truncate | back to summary |
|---|---|
| public long truncate(long size) Truncate file to size in bytes. Returns the new size.
| |
| unsupported | back to summary |
|---|---|
| protected void unsupported(String methodName) Raise a TypeError indicating the specified operation is not supported.
| |
| writable | back to summary |
|---|---|
| public boolean writable() Return whether this file was opened for writing.
| |