Package net.sourceforge.htmlunit.corejs.javascript.serialize

Examples of net.sourceforge.htmlunit.corejs.javascript.serialize.ScriptableInputStream


  public static Object deserialize( Context cx, Scriptable thisObj, Object[] args, Function funObj ) throws IOException, ClassNotFoundException {
    if ( args.length < 1 ) { throw Context.reportRuntimeError( "Expected a filename to read the serialization from" ); }
    String filename = Context.toString( args[ 0 ] );
    FileInputStream fis = new FileInputStream( filename );
    Scriptable scope = ScriptableObject.getTopLevelScope( thisObj );
    ObjectInputStream in = new ScriptableInputStream( fis, scope );
    Object deserialized = in.readObject();
    in.close();
    return Context.toObject( deserialized, scope );
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.htmlunit.corejs.javascript.serialize.ScriptableInputStream

Copyright © 2018 www.massapicom. 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.