Class RiverMarshaller
- All Implemented Interfaces:
Closeable, DataOutput, Flushable, ObjectOutput, AutoCloseable, ByteOutput, Marshaller
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final IdentityIntMap<Class<?>> private static final IdentityIntMap<Class<?>> private BlockMarshallerprivate final IdentityIntMap<Class<?>> private intprivate final PrivilegedExceptionAction<RiverObjectOutputStream> private static final Fieldprivate static final Fieldprivate static final Fieldprivate final IdentityHashMap<Class<?>, Externalizer> private final IdentityIntMap<Object> private intprivate ObjectOutputprivate RiverObjectOutputStreamprivate final SerializableClassRegistryFields inherited from class AbstractMarshaller
classExternalizerFactory, classResolver, classTable, configuredVersion, exceptionListener, objectPreResolver, objectResolver, objectTable, serializabilityChecker, streamHeaderFields inherited from class SimpleDataOutput
buffer, bufferSizeFields inherited from class ByteOutputStream
byteOutput -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRiverMarshaller(RiverMarshallerFactory marshallerFactory, SerializableClassRegistry registry, MarshallingConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoidDiscard the class cache.voidDiscard the instance cache.private RiverObjectOutputStreamprotected voidprotected voiddoWriteFields(SerializableClass info, Object obj) protected voiddoWriteObject(Object original, boolean unshared) Implementation of the actual object-writing method.protected voiddoWriteSerializableObject(SerializableClass info, Object obj, Class<?> objClass) getAccessibleEnumFieldValue(Field field, Object obj) private static IdentityIntMap<Class<?>> getBasicClasses(int configuredVersion) protected BlockMarshallergetEnumMapKeyType(Object obj) private static Enum[]getEnumSetElements(Object obj) protected ObjectOutputprivate RiverObjectOutputStreamvoidstart(ByteOutput byteOutput) Begin writing to a stream.private voidwriteBooleanArray(boolean[] booleans) protected voidwriteClass(Class<?> objClass) protected voidwriteClassClass(Class<?> classObj) private voidwriteClassTableData(Class<?> objClass, ClassTable.Writer classTableWriter) private voidprotected voidwriteEnumClass(Class<? extends Enum> objClass) protected voidwriteExternalizableClass(Class<?> objClass) protected voidwriteExternalizerClass(Class<?> objClass, Externalizer externalizer) protected booleanwriteKnownClass(Class<?> objClass) protected voidwriteNewClass(Class<?> objClass) protected voidwriteNewEnumClass(Class<? extends Enum> objClass) protected voidwriteNewExternalizableClass(Class<?> objClass) protected voidwriteNewExternalizerClass(Class<?> objClass, Externalizer externalizer) protected voidwriteNewProxyClass(Class<?> objClass) protected voidwriteNewSerializableClass(Class<?> objClass) protected voidwriteObjectArrayClass(Class<?> objClass) protected voidwriteProxyClass(Class<?> objClass) protected voidwriteSerializableClass(Class<?> objClass) private voidwriteString(String string) voidMethods inherited from class AbstractMarshaller
close, finish, writeObject, writeObjectUnsharedMethods inherited from class SimpleDataOutput
flush, shallowFlush, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShortMethods inherited from class OutputStream
nullOutputStreamMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ByteOutput
write, write, writeMethods inherited from interface DataOutput
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShortMethods inherited from interface ObjectOutput
flush, write, write, write
-
Field Details
-
instanceCache
-
classCache
-
externalizers
-
instanceSeq
private int instanceSeq -
classSeq
private int classSeq -
registry
-
objectOutputStream
-
objectOutput
-
blockMarshaller
-
createObjectOutputStreamAction
-
BASIC_CLASSES_V2
-
BASIC_CLASSES_V3
-
ENUM_SET_ELEMENT_TYPE_FIELD
-
ENUM_SET_VALUES_FIELD
-
ENUM_MAP_KEY_TYPE_FIELD
-
-
Constructor Details
-
RiverMarshaller
protected RiverMarshaller(RiverMarshallerFactory marshallerFactory, SerializableClassRegistry registry, MarshallingConfiguration configuration) throws IOException - Throws:
IOException
-
-
Method Details
-
doWriteObject
Description copied from class:AbstractObjectOutputImplementation of the actual object-writing method.- Specified by:
doWriteObjectin classAbstractObjectOutput- Parameters:
original- the object to writeunshared-trueif the instance is unshared,falseif it is shared- Throws:
IOException- if an I/O error occurs
-
getBasicClasses
-
getEnumMapKeyType
-
getEnumSetElementType
-
getEnumSetElements
-
getAccessibleEnumFieldValue
-
writeBooleanArray
- Throws:
IOException
-
writeEndBlock
- Throws:
IOException
-
getObjectOutput
-
getBlockMarshaller
-
getObjectOutputStream
- Throws:
IOException
-
createObjectOutputStream
- Throws:
IOException
-
doWriteSerializableObject
protected void doWriteSerializableObject(SerializableClass info, Object obj, Class<?> objClass) throws IOException - Throws:
IOException
-
doWriteFields
- Throws:
IOException
-
doWriteEmptyFields
- Throws:
IOException
-
writeProxyClass
- Throws:
IOException
-
writeNewProxyClass
- Throws:
IOException
-
writeEnumClass
- Throws:
IOException
-
writeNewEnumClass
- Throws:
IOException
-
writeClassClass
- Throws:
IOException
-
writeObjectArrayClass
- Throws:
IOException
-
writeClass
- Throws:
IOException
-
writeNewClass
- Throws:
IOException
-
writeClassTableData
private void writeClassTableData(Class<?> objClass, ClassTable.Writer classTableWriter) throws IOException - Throws:
IOException
-
writeKnownClass
- Throws:
IOException
-
writeSerializableClass
- Throws:
IOException
-
writeNewSerializableClass
- Throws:
IOException
-
writeExternalizableClass
- Throws:
IOException
-
writeNewExternalizableClass
- Throws:
IOException
-
writeExternalizerClass
protected void writeExternalizerClass(Class<?> objClass, Externalizer externalizer) throws IOException - Throws:
IOException
-
writeNewExternalizerClass
protected void writeNewExternalizerClass(Class<?> objClass, Externalizer externalizer) throws IOException - Throws:
IOException
-
clearInstanceCache
Description copied from interface:MarshallerDiscard the instance cache. May also discard the class cache in implementations that do not support separated class and instance caches.- Throws:
IOException- if an error occurs
-
clearClassCache
Description copied from interface:MarshallerDiscard the class cache. Implicitly also discards the instance cache.- Throws:
IOException- if an error occurs
-
start
Description copied from class:AbstractMarshallerBegin writing to a stream.- Specified by:
startin interfaceMarshaller- Overrides:
startin classAbstractMarshaller- Parameters:
byteOutput- the new stream- Throws:
IOException- if an error occurs
-
writeString
- Throws:
IOException
-
writeUTF
Description copied from class:SimpleDataOutput- Specified by:
writeUTFin interfaceDataOutput- Overrides:
writeUTFin classSimpleDataOutput- Throws:
IOException
-