Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
Rhino is an open-source implementation of JavaScript written entirely in
Java. It is typically embedded into Java applications to provide
scripting to end users.
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package jscover.mozilla.javascript.serialize;
import java.util.Map;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.io.*;
import jscover.mozilla.javascript.*;
/**
* Class ScriptableOutputStream is an ObjectOutputStream used
* to serialize JavaScript objects and functions. Note that
* compiled functions currently cannot be serialized, only
* interpreted functions. The top-level scope containing the
* object is not written out, but is instead replaced with
* another top-level object when the ScriptableInputStream
* reads in this object. Also, object corresponding to names
* added to the exclude list are not written out but instead
* are looked up during deserialization. This approach avoids
* the creation of duplicate copies of standard objects
* during deserialization.
*
* @author Norris Boyd
*/
// API class
public class ScriptableOutputStream extends ObjectOutputStream {
/**
* ScriptableOutputStream constructor.
* Creates a ScriptableOutputStream for use in serializing
* JavaScript objects. Calls excludeStandardObjectNames.
*
* @param out the OutputStream to write to.
* @param scope the scope containing the object.
*/
public ScriptableOutputStream(OutputStream out, Scriptable scope)
throws IOException
{
super(out);
this.scope = scope;
table = new HashMap