_jyio (Jython API documentation)
Date: 2024-08-18

org.python.modules._io

## Class _jyio

- java.lang.Object
- - org.python.modules._io._jyio

- All Implemented Interfaces:
    ClassDictInit

      public class _jyio
      extends java.lang.Object
      implements ClassDictInit

  The Python _io module implemented in Java.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `__doc__`
    `static java.lang.String` | `__doc__open`
    `static PyInteger` | `DEFAULT_BUFFER_SIZE` Default buffer size for export.
    `static PyType` | `UnsupportedOperation` A Python class for the `UnsupportedOperation` exception.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `_jyio()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `classDictInit(PyObject dict)` This method is called when the module is loaded, to populate the namespace (dictionary) of the module.
    `static PyObject` | `open(PyObject[] args, java.lang.String[] kwds)` Open file and return a stream.
    `static PyException` | `UnsupportedOperation(java.lang.String message)` A function that returns a `PyException`, which is a Java exception suitable for throwing, and that will be raised as an `UnsupportedOperation` Python exception.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### UnsupportedOperation

          public static PyType UnsupportedOperation

      A Python class for the `UnsupportedOperation` exception.

    - #### DEFAULT_BUFFER_SIZE

          public static final PyInteger DEFAULT_BUFFER_SIZE

      Default buffer size for export.

    - #### __doc__

          public static final java.lang.String __doc__

      See Also:
        Constant Field Values

    - #### __doc__open

          public static final java.lang.String __doc__open

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### _jyio

          public _jyio()

  - ### Method Detail

    - #### classDictInit

          public static void classDictInit(PyObject dict)

      This method is called when the module is loaded, to populate the namespace (dictionary) of the module. The dictionary has been initialised at this point reflectively from the methods of this class and this method nulls those entries that ought not to be exposed.
      Parameters:
        `dict` - namespace of the module

    - #### UnsupportedOperation

          public static PyException UnsupportedOperation(java.lang.String message)

      A function that returns a `PyException`, which is a Java exception suitable for throwing, and that will be raised as an `UnsupportedOperation` Python exception.
      Parameters:
        `message` - text message parameter to the Python exception
      Returns:
        nascent `UnsupportedOperation` Python exception

    - #### open

          public static PyObject open(PyObject[] args,
                                      java.lang.String[] kwds)

      Open file and return a stream. Raise IOError upon failure. This is a port to Java of the CPython _io.open (Modules/_io/_iomodule.c) following the same logic, but expressed with the benefits of Java syntax.
      Parameters:
        `args` - array of arguments from Python call via Jython framework
        `kwds` - array of keywords from Python call via Jython framework
      Returns:
        the stream object

Jython homepage