All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.org.python.core.io.FileDescriptors Maven / Gradle / Ivy

Go to download

Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform.

There is a newer version: 2.7.4
Show newest version
/* Copyright (c) 2007 Jython Developers */
package org.python.core.io;

import org.python.core.Py;
import org.python.core.PyObject;

/**
 * Jython file descriptor management.
 *
 * File descriptor objects in Jython are instances of RawIOBase.
 *
 * @author Philip Jenvey
 */
public class FileDescriptors {

    /**
     * Return the RawIOBase associated with the specified file descriptor.
     *
     * Raises a Python exception is the file descriptor is invalid
     *
     * @param fd
     *            a Jython file descriptor object
     * @return the RawIOBase associated with the file descriptor
     */
    public static RawIOBase get(PyObject fd) {
        return Py.tojava(fd, RawIOBase.class);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy