Class Archiver
All Packages Class Hierarchy This Package Previous Next Index
Class Archiver
public class netscape.util.Archiver
extends java.lang.Object
implements netscape.util.Encoder
{
/* Constructors
*/
public Archiver(Archive);
/* Methods
*/
public static void writeObject(OutputStream, Object);
public Archive archive();
public void archiveRootObject(Object);
public void encodeBoolean(String, boolean);
public void encodeBooleanArray(String, boolean[], int, int);
public void encodeByte(String, byte);
public void encodeByteArray(String, byte[], int, int);
public void encodeChar(String, char);
public void encodeCharArray(String, char[], int, int);
public void encodeDouble(String, double);
public void encodeDoubleArray(String, double[], int, int);
public void encodeFloat(String, float);
public void encodeFloatArray(String, float[], int, int);
public void encodeInt(String, int);
public void encodeIntArray(String, int[], int, int);
public void encodeLong(String, long);
public void encodeLongArray(String, long[], int, int);
public void encodeObject(String, Object);
public void encodeObjectArray(String, Object[], int, int);
public void encodeShort(String, short);
public void encodeShortArray(String, short[], int, int);
public void encodeString(String, String);
public void encodeStringArray(String, String[], int, int);
}
Object subclass implementing the Encoder interface to encode a graph of
objects to an Archive. The following example demonstrates how to use an
Archiver to write a graph of objects, starting from rootObject to the
stream System.out:
archiver = new Archiver(new Archive());
archiver.archiveRootObject(rootObject);
archiver.archive().writeASCII(System.out, true);
- See Also:
- Encoder, Archive
Constructors
.Archiver
public Archiver(Archive archive)
- Constructs an Archiver that writes to archive.
Methods
public Archive archive()
- Returns the archive used by the Archiver.
public static void writeObject(java.io.OutputStream outputStream,
Object root) throws IOException, CodingException
- A convenience method for writing an object to a stream. Equivilent to:
archive = new Archive();
archiver = new Archiver(archive);
archiver.archiveRootObject(root);
archive.write(out);
public void archiveRootObject(Object root) throws CodingException
- Starts the archiving process. This method can be called multiple
times to encode more than one graph (which may or may not overlap)
into an Archive. This automatically adds the object to the Archive's
array of root identifiers.
public void encodeBoolean(String key,
boolean value) throws CodingException
- Encoder interface method that encodes the boolean value,
associating it with the string key.
public void encodeBooleanArray(String key,
boolean value[],
int offset,
int length) throws CodingException
- Encoder interface method that encodes the boolean array value,
associating it with the string key.
public void encodeChar(String key,
char value) throws CodingException
- Encoder interface method that encodes the character value,
associating it with the string key.
public void encodeCharArray(String key,
char value[],
int offset,
int length) throws CodingException
- Encoder interface method that encodes the character array value,
associating it with the string key.
public void encodeByte(String key,
byte value) throws CodingException
- Encoder interface method that encodes the byte value,
associating it with the string key.
public void encodeByteArray(String key,
byte value[],
int offset,
int length) throws CodingException
- Encoder interface method that encodes the byte array value,
associating it with the string key.
public void encodeShort(String key,
short value) throws CodingException
- Encoder interface method that encodes the short value,
associating it with the string key.
public void encodeShortArray(String key,
short value[],
int offset,
int length) throws CodingException
- Encoder interface method that encodes the short array value,
associating it with the string key.
public void encodeInt(String key,
int value) throws CodingException
- Encoder interface method that encodes the integer value,
associating it with the string key.
public void encodeIntArray(String key,
int value[],
int offset,
int length) throws CodingException
- Encoder interface method that encodes the integer array value,
associating it with the string key.
public void encodeLong(String key,
long value) throws CodingException
- Encoder interface method that encodes the long value,
associating it with the string key.
public void encodeLongArray(String key,
long value[],
int offset,
int length) throws CodingException
- Encoder interface method that encodes the long array value,
associating it with the string key.
public void encodeFloat(String key,
float value) throws CodingException
- Encoder interface method that encodes the float value,
associating it with the string key.
public void encodeFloatArray(String key,
float value[],
int offset,
int length) throws CodingException
- Encoder interface method that encodes the float array value,
associating it with the string key.
public void encodeDouble(String key,
double value) throws CodingException
- Encoder interface method that encodes the double value,
associating it with the string key.
public void encodeDoubleArray(String key,
double value[],
int offset,
int length) throws CodingException
- Encoder interface method that encodes the double array value,
associating it with the string key.
public void encodeString(String key,
String value) throws CodingException
- Encoder interface method that encodes the string value,
associating it with the string key.
public void encodeStringArray(String key,
String value[],
int offset,
int length) throws CodingException
- Encoder interface method that encodes the string array value,
associating it with the string key.
public void encodeObject(String key,
Object value) throws CodingException
- Encoder interface method that encodes a reference to another Codable
object. If multiple objects reference the same object and each passes
it to encodeObject(), only one copy of that object is actually
encoded.
public void encodeObjectArray(String key,
Object value[],
int offset,
int length) throws CodingException
- Encoder interface method that encodes an array of Codable objects. The
reference to the array is not shared, but references to the objects in
the array are.
All Packages Class Hierarchy This Package Previous Next Index
Copyright © 1997 Netscape Communications Corporation. All rights reserved
Please send any comments or corrections to ifcfeedback@netscape.com
HTML generated on 21 Oct 1997