Examples of PythonObjectInputStream


Examples of org.python.util.PythonObjectInputStream

    }

    public void testDirect() throws IOException, ClassNotFoundException {
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        new ObjectOutputStream(os).writeObject(interp.get("x"));
        new PythonObjectInputStream(new ByteArrayInputStream(os.toByteArray())).readObject();
    }
View Full Code Here

Examples of org.python.util.PythonObjectInputStream

                        // loading sometimes fails if a new interpreter is
                        // created, so
                        // we use the one from the NengoGraphics.
                        PythonInterpreter pi = NengoGraphics.getInstance().getPythonInterpreter();
                        pi.set("___inStream",
                                new PythonObjectInputStream(new FileInputStream(file)));
                        org.python.core.PyObject obj = pi.eval("___inStream.readObject()");
                        objLoaded = obj.__tojava__(Class.forName("ca.nengo.model.Node"));
                        pi.exec("del ___inStream");

                        SwingUtilities.invokeLater(new Runnable() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.