public class RiverMarshaller extends AbstractMarshaller
| Modifier and Type | Field and Description |
|---|---|
private static IdentityIntMap<java.lang.Class<?>> |
BASIC_CLASSES_V2 |
private static IdentityIntMap<java.lang.Class<?>> |
BASIC_CLASSES_V3 |
private BlockMarshaller |
blockMarshaller |
private IdentityIntMap<java.lang.Class<?>> |
classCache |
private int |
classSeq |
private java.security.PrivilegedExceptionAction<RiverObjectOutputStream> |
createObjectOutputStreamAction |
private static java.lang.reflect.Field |
ENUM_MAP_KEY_TYPE_FIELD |
private static java.lang.reflect.Field |
ENUM_SET_ELEMENT_TYPE_FIELD |
private static java.lang.reflect.Field |
ENUM_SET_VALUES_FIELD |
private java.util.IdentityHashMap<java.lang.Class<?>,Externalizer> |
externalizers |
private IdentityIntMap<java.lang.Object> |
instanceCache |
private int |
instanceSeq |
private java.io.ObjectOutput |
objectOutput |
private RiverObjectOutputStream |
objectOutputStream |
private SerializableClassRegistry |
registry |
classExternalizerFactory, classResolver, classTable, configuredVersion, exceptionListener, objectPreResolver, objectResolver, objectTable, serializabilityChecker, streamHeaderbuffer, bufferSizebyteOutput| Modifier | Constructor and Description |
|---|---|
protected |
RiverMarshaller(RiverMarshallerFactory marshallerFactory,
SerializableClassRegistry registry,
MarshallingConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearClassCache()
Discard the class cache.
|
void |
clearInstanceCache()
Discard the instance cache.
|
private RiverObjectOutputStream |
createObjectOutputStream() |
protected void |
doWriteEmptyFields(SerializableClass info) |
protected void |
doWriteFields(SerializableClass info,
java.lang.Object obj) |
protected void |
doWriteObject(java.lang.Object original,
boolean unshared)
Implementation of the actual object-writing method.
|
protected void |
doWriteSerializableObject(SerializableClass info,
java.lang.Object obj,
java.lang.Class<?> objClass) |
private static java.lang.Class<? extends java.lang.Enum> |
getAccessibleEnumFieldValue(java.lang.reflect.Field field,
java.lang.Object obj) |
private static IdentityIntMap<java.lang.Class<?>> |
getBasicClasses(int configuredVersion) |
protected BlockMarshaller |
getBlockMarshaller() |
private static java.lang.Class<? extends java.lang.Enum> |
getEnumMapKeyType(java.lang.Object obj) |
private static java.lang.Enum[] |
getEnumSetElements(java.lang.Object obj) |
private static java.lang.Class<? extends java.lang.Enum> |
getEnumSetElementType(java.lang.Object obj) |
protected java.io.ObjectOutput |
getObjectOutput() |
private RiverObjectOutputStream |
getObjectOutputStream() |
void |
start(ByteOutput byteOutput)
Begin writing to a stream.
|
private void |
writeBooleanArray(boolean[] booleans) |
protected void |
writeClass(java.lang.Class<?> objClass) |
protected void |
writeClassClass(java.lang.Class<?> classObj) |
private void |
writeClassTableData(java.lang.Class<?> objClass,
ClassTable.Writer classTableWriter) |
private void |
writeEndBlock() |
protected void |
writeEnumClass(java.lang.Class<? extends java.lang.Enum> objClass) |
protected void |
writeExternalizableClass(java.lang.Class<?> objClass) |
protected void |
writeExternalizerClass(java.lang.Class<?> objClass,
Externalizer externalizer) |
protected boolean |
writeKnownClass(java.lang.Class<?> objClass) |
protected void |
writeNewClass(java.lang.Class<?> objClass) |
protected void |
writeNewEnumClass(java.lang.Class<? extends java.lang.Enum> objClass) |
protected void |
writeNewExternalizableClass(java.lang.Class<?> objClass) |
protected void |
writeNewExternalizerClass(java.lang.Class<?> objClass,
Externalizer externalizer) |
protected void |
writeNewProxyClass(java.lang.Class<?> objClass) |
protected void |
writeNewSerializableClass(java.lang.Class<?> objClass) |
protected void |
writeObjectArrayClass(java.lang.Class<?> objClass) |
protected void |
writeProxyClass(java.lang.Class<?> objClass) |
protected void |
writeSerializableClass(java.lang.Class<?> objClass) |
private void |
writeString(java.lang.String string) |
void |
writeUTF(java.lang.String string) |
close, finish, writeObject, writeObjectUnsharedflush, shallowFlush, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShortclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwriteBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShortwrite, write, writeprivate final IdentityIntMap<java.lang.Object> instanceCache
private final IdentityIntMap<java.lang.Class<?>> classCache
private final java.util.IdentityHashMap<java.lang.Class<?>,Externalizer> externalizers
private int instanceSeq
private int classSeq
private final SerializableClassRegistry registry
private RiverObjectOutputStream objectOutputStream
private java.io.ObjectOutput objectOutput
private BlockMarshaller blockMarshaller
private final java.security.PrivilegedExceptionAction<RiverObjectOutputStream> createObjectOutputStreamAction
private static final IdentityIntMap<java.lang.Class<?>> BASIC_CLASSES_V2
private static final IdentityIntMap<java.lang.Class<?>> BASIC_CLASSES_V3
private static final java.lang.reflect.Field ENUM_SET_ELEMENT_TYPE_FIELD
private static final java.lang.reflect.Field ENUM_SET_VALUES_FIELD
private static final java.lang.reflect.Field ENUM_MAP_KEY_TYPE_FIELD
protected RiverMarshaller(RiverMarshallerFactory marshallerFactory, SerializableClassRegistry registry, MarshallingConfiguration configuration) throws java.io.IOException
java.io.IOExceptionprotected void doWriteObject(java.lang.Object original,
boolean unshared)
throws java.io.IOException
AbstractObjectOutputdoWriteObject in class AbstractObjectOutputoriginal - the object to writeunshared - true if the instance is unshared, false if it is sharedjava.io.IOException - if an I/O error occursprivate static IdentityIntMap<java.lang.Class<?>> getBasicClasses(int configuredVersion)
private static java.lang.Class<? extends java.lang.Enum> getEnumMapKeyType(java.lang.Object obj)
private static java.lang.Class<? extends java.lang.Enum> getEnumSetElementType(java.lang.Object obj)
private static java.lang.Enum[] getEnumSetElements(java.lang.Object obj)
private static java.lang.Class<? extends java.lang.Enum> getAccessibleEnumFieldValue(java.lang.reflect.Field field,
java.lang.Object obj)
private void writeBooleanArray(boolean[] booleans)
throws java.io.IOException
java.io.IOExceptionprivate void writeEndBlock()
throws java.io.IOException
java.io.IOExceptionprotected java.io.ObjectOutput getObjectOutput()
protected BlockMarshaller getBlockMarshaller()
private RiverObjectOutputStream getObjectOutputStream() throws java.io.IOException
java.io.IOExceptionprivate RiverObjectOutputStream createObjectOutputStream() throws java.io.IOException
java.io.IOExceptionprotected void doWriteSerializableObject(SerializableClass info, java.lang.Object obj, java.lang.Class<?> objClass) throws java.io.IOException
java.io.IOExceptionprotected void doWriteFields(SerializableClass info, java.lang.Object obj) throws java.io.IOException
java.io.IOExceptionprotected void doWriteEmptyFields(SerializableClass info) throws java.io.IOException
java.io.IOExceptionprotected void writeProxyClass(java.lang.Class<?> objClass)
throws java.io.IOException
java.io.IOExceptionprotected void writeNewProxyClass(java.lang.Class<?> objClass)
throws java.io.IOException
java.io.IOExceptionprotected void writeEnumClass(java.lang.Class<? extends java.lang.Enum> objClass)
throws java.io.IOException
java.io.IOExceptionprotected void writeNewEnumClass(java.lang.Class<? extends java.lang.Enum> objClass)
throws java.io.IOException
java.io.IOExceptionprotected void writeClassClass(java.lang.Class<?> classObj)
throws java.io.IOException
java.io.IOExceptionprotected void writeObjectArrayClass(java.lang.Class<?> objClass)
throws java.io.IOException
java.io.IOExceptionprotected void writeClass(java.lang.Class<?> objClass)
throws java.io.IOException
java.io.IOExceptionprotected void writeNewClass(java.lang.Class<?> objClass)
throws java.io.IOException
java.io.IOExceptionprivate void writeClassTableData(java.lang.Class<?> objClass,
ClassTable.Writer classTableWriter)
throws java.io.IOException
java.io.IOExceptionprotected boolean writeKnownClass(java.lang.Class<?> objClass)
throws java.io.IOException
java.io.IOExceptionprotected void writeSerializableClass(java.lang.Class<?> objClass)
throws java.io.IOException
java.io.IOExceptionprotected void writeNewSerializableClass(java.lang.Class<?> objClass)
throws java.io.IOException
java.io.IOExceptionprotected void writeExternalizableClass(java.lang.Class<?> objClass)
throws java.io.IOException
java.io.IOExceptionprotected void writeNewExternalizableClass(java.lang.Class<?> objClass)
throws java.io.IOException
java.io.IOExceptionprotected void writeExternalizerClass(java.lang.Class<?> objClass,
Externalizer externalizer)
throws java.io.IOException
java.io.IOExceptionprotected void writeNewExternalizerClass(java.lang.Class<?> objClass,
Externalizer externalizer)
throws java.io.IOException
java.io.IOExceptionpublic void clearInstanceCache()
throws java.io.IOException
Marshallerjava.io.IOException - if an error occurspublic void clearClassCache()
throws java.io.IOException
Marshallerjava.io.IOException - if an error occurspublic void start(ByteOutput byteOutput) throws java.io.IOException
AbstractMarshallerstart in interface Marshallerstart in class AbstractMarshallerbyteOutput - the new streamjava.io.IOException - if an error occursprivate void writeString(java.lang.String string)
throws java.io.IOException
java.io.IOExceptionpublic void writeUTF(java.lang.String string)
throws java.io.IOException
SimpleDataOutputwriteUTF in interface java.io.DataOutputwriteUTF in class SimpleDataOutputjava.io.IOException