public class SerializedObject
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
SerializedObject(java.lang.Object obj)
Serializes the supplied object into a byte array without compression.
|
SerializedObject(java.lang.Object obj,
boolean compress)
Serializes the supplied object into a byte array.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Compares this object with another for equality.
|
java.lang.Object |
getObject()
Gets the object stored in this SerializedObject.
|
int |
hashCode()
Returns a hashcode for this object.
|
static void |
main(java.lang.String[] args)
Test routine, reads an data file from stdin and measures memory usage
(the data file should have long string attribute values)
|
static void |
main2(java.lang.String[] args)
Test routine, reads text from stdin and measures memory usage
|
protected static byte[] |
toByteArray(java.lang.Object obj,
boolean compress)
Serializes the supplied object to a byte array.
|
java.lang.String |
toString()
Returns a text representation of the state of this object.
|
public SerializedObject(java.lang.Object obj) throws java.lang.Exception
obj
- the Object to serialize.java.lang.Exception
- if the object is not Serializable.public SerializedObject(java.lang.Object obj, boolean compress) throws java.lang.Exception
obj
- the Object to serialize.compress
- true if the object should be stored compressed.java.lang.Exception
- if the object is not Serializable.protected static byte[] toByteArray(java.lang.Object obj, boolean compress) throws java.lang.Exception
obj
- the Object to serializecompress
- true if the object should be compressed.java.lang.Exception
- if the object is not Serializable.public java.lang.Object getObject()
public final boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the other Object.public final int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static void main2(java.lang.String[] args)
args
- main args.public static void main(java.lang.String[] args)
args
- main args.