Object obj = args[ 0 ];
String filename = Context.toString( args[ 1 ] );
FileOutputStream fos = new FileOutputStream( filename );
Scriptable scope = ScriptableObject.getTopLevelScope( thisObj );
ScriptableOutputStream out = new ScriptableOutputStream( fos, scope );
out.writeObject( obj );
out.close();
}
@GlobalFunction
public static Object deserialize( Context cx, Scriptable thisObj, Object[] args, Function funObj ) throws IOException, ClassNotFoundException {