| Modifier and Type | Field and Description |
|---|---|
| public final boolean | closefd
Whether to close the underlying stream on closing this object. |
| private static final PyString | |
| private RawIOBase | ioDelegate
The |
| public final PyString | mode
The mode as a PyString based on readable and writable |
| private static final String[] | |
| private boolean | readable
Set true when stream must be |
| private boolean | seekable
Set true when stream is seekable |
| private boolean | seekableKnown
Set true when we have made the seekable test |
| public static final PyType | |
| private boolean | writable
Set true when stream must be |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PyFileIO(PyType
for which construction is occurring subtype, PyObject path or descriptor on which this should be constructed file, OpenMode type of access specified mode, boolean if closefd)false, do not close file on call to
close()Construct an open |
| Modifier and Type | Method and Description |
|---|---|
| private final long | |
| private final long | |
| public void | close()
Overrides org. Close the underlying ioDelegate only if |
| private PyException | Returns: ValueError to throwConvenience method providing the exception when an method requires the file to be open, and it isn't. |
| pack-priv static PyObject | FileIO___new__(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)
Create a |
| pack-priv final synchronized void | |
| pack-priv final PyObject | |
| pack-priv final void | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final PyLong | |
| pack-priv final long | |
| pack-priv final boolean | |
| pack-priv final String | |
| pack-priv final long | |
| pack-priv final boolean | |
| pack-priv final PyLong | |
| public PyObject | |
| public void | flush()
Overrides org. Flush write buffers, or no-op for read-only and non-blocking streams. |
| public boolean | isatty()
Overrides org. Is the stream known to be an interactive console? |
| public final void | |
| public boolean | |
| public PyObject | readinto(PyObject
byte array to try to fill buf)Overrides org. Read up to |
| public long | seek(long
relative to the specified point pos, int 0=from start, 1=from here, 2=from end whence)Overrides org. Position the read or write pointer at a given byte offset |
| public boolean | seekable()
Overrides org. Is the stream capable of positioning the read/write pointer? |
| private void | setDelegate(PyObject
name or descriptor file, OpenMode parsed file open mode mode)Helper function that turns the arguments of the most general constructor, or
|
| private PyException | Returns: ValueError to throwtype of operation not valid ("read" or "writ" in practice). action)Convenience method providing the exception when an method requires the file to be open, readable or writable, and it isn't. |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| public long | truncate()
Overrides org. Truncate file to |
| public long | truncate(long
requested for stream size)Overrides org. Truncate file to |
| public boolean | |
| public PyObject | write(PyObject
buffer of bytes to be written buf)Overrides org. Write the given bytes or bytearray object to the underlying raw stream and return the number of bytes written. |
| closefd | back to summary |
|---|---|
| public final boolean closefd Whether to close the underlying stream on closing this object.
| |
| defaultMode | back to summary |
|---|---|
| private static final PyString defaultMode | |
| ioDelegate | back to summary |
|---|---|
| private RawIOBase ioDelegate The | |
| mode | back to summary |
|---|---|
| public final PyString mode The mode as a PyString based on readable and writable
| |
| openArgs | back to summary |
|---|---|
| private static final String[] openArgs | |
| readable | back to summary |
|---|---|
| private boolean readable Set true when stream must be | |
| seekable | back to summary |
|---|---|
| private boolean seekable Set true when stream is seekable | |
| seekableKnown | back to summary |
|---|---|
| private boolean seekableKnown Set true when we have made the seekable test | |
| TYPE | back to summary |
|---|---|
| public static final PyType TYPE | |
| writable | back to summary |
|---|---|
| private boolean writable Set true when stream must be | |
| PyFileIO | back to summary |
|---|---|
| public PyFileIO(PyObject file, OpenMode mode, boolean closefd) Construct an open | |
| PyFileIO | back to summary |
|---|---|
| public PyFileIO(PyType subtype, PyObject file, OpenMode mode, boolean closefd) Construct an open | |
| _truncate | back to summary |
|---|---|
| private final long _truncate() Common to FileIO_truncate(null) and truncate(). | |
| _truncate | back to summary |
|---|---|
| private final long _truncate(long size) Common to FileIO_truncate(size) and truncate(size). | |
| close | back to summary |
|---|---|
| public void close() Overrides org. Close the underlying ioDelegate only if
| |
| closedValueError | back to summary |
|---|---|
| private PyException closedValueError() Convenience method providing the exception when an method requires the file to be open, and it isn't.
| |
| FileIO___new__ | back to summary |
|---|---|
| pack-priv static PyObject FileIO___new__(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords) Create a
| |
| FileIO_close | back to summary |
|---|---|
pack-priv final synchronized void FileIO_close()
| |
| FileIO_fileno | back to summary |
|---|---|
pack-priv final PyObject FileIO_fileno()
| |
| FileIO_flush | back to summary |
|---|---|
pack-priv final void FileIO_flush()
| |
| FileIO_isatty | back to summary |
|---|---|
pack-priv final boolean FileIO_isatty()
| |
| FileIO_readable | back to summary |
|---|---|
pack-priv final boolean FileIO_readable()
| |
| FileIO_readinto | back to summary |
|---|---|
pack-priv final PyLong FileIO_readinto(PyObject buf)
| |
| FileIO_seek | back to summary |
|---|---|
pack-priv final long FileIO_seek(long pos, int whence)
| |
| FileIO_seekable | back to summary |
|---|---|
pack-priv final boolean FileIO_seekable()
| |
| FileIO_toString | back to summary |
|---|---|
pack-priv final String FileIO_toString()
| |
| FileIO_truncate | back to summary |
|---|---|
pack-priv final long FileIO_truncate(PyObject size)
| |
| FileIO_writable | back to summary |
|---|---|
pack-priv final boolean FileIO_writable()
| |
| FileIO_write | back to summary |
|---|---|
pack-priv final PyLong FileIO_write(PyObject buf)
| |
| fileno | back to summary |
|---|---|
| public PyObject fileno() Overrides org. Doc from org. Return a file descriptor for the stream. A CPython file descriptor is an int, but this is not
the natural choice in Jython, since Java has no such convention of using integers. File
descriptors should be passed around opaquely, so their actual type is irrelevant, as long as
(say) | |
| flush | back to summary |
|---|---|
| public void flush() Overrides org. Doc from org. Flush write buffers, or no-op for read-only and non-blocking streams. Irrespective of the concrete type of the i/o object, locally-buffered write data is written downstream. Whether the downstream in object is also flushed depends upon the specific type of this object.
| |
| isatty | back to summary |
|---|---|
| public boolean isatty() Overrides org. Doc from org. Is the stream known to be an interactive console? This relies on the ability of the underlying stream to know, which is not always possible.
| |
| mode_readonly | back to summary |
|---|---|
public final void mode_readonly(PyString value)
| |
| readable | back to summary |
|---|---|
| public boolean readable() throws PyException Overrides org. Doc from org. Is the stream readable?
| |
| readinto | back to summary |
|---|---|
| public PyObject readinto(PyObject buf) Overrides org. Doc from org. Read up to | |
| seek | back to summary |
|---|---|
| public long seek(long pos, int whence) Overrides org. Doc from org. Position the read or write pointer at a given byte offset
the new current position | |
| seekable | back to summary |
|---|---|
| public boolean seekable() Overrides org. Doc from org. Is the stream capable of positioning the read/write pointer?
| |
| setDelegate | back to summary |
|---|---|
| private void setDelegate(PyObject file, OpenMode mode) Helper function that turns the arguments of the most general constructor, or
In many cases (such as construction from a file name, the FileIO is a newly-opened file. When the file object passed in is a file descriptor, the FileIO may be created to wrap that existing stream. | |
| tailoredValueError | back to summary |
|---|---|
| private PyException tailoredValueError(String action) Convenience method providing the exception when an method requires the file to be open, readable or writable, and it isn't. If the file is closed, return the message for that, otherwise, one about reading or writing.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| truncate | back to summary |
|---|---|
| public long truncate() Overrides org. Doc from org. Truncate file to
| |
| truncate | back to summary |
|---|---|
| public long truncate(long size) Overrides org. Doc from org. Truncate file to
| |
| writable | back to summary |
|---|---|
| public boolean writable() throws PyException Overrides org. Doc from org. Is the stream writable?
| |
| write | back to summary |
|---|---|
| public PyObject write(PyObject buf) Overrides org. Doc from org. Write the given bytes or bytearray object to the underlying raw stream and return the number of bytes written. | |