public final class SerialMarshaller extends AbstractMarshaller implements Marshaller, ExtendedObjectStreamConstants
| Modifier and Type | Field and Description |
|---|---|
private BlockMarshaller |
blockMarshaller |
private int |
bufferSize |
private java.security.PrivilegedExceptionAction<SerialObjectOutputStream> |
createObjectOutputStreamAction |
private IdentityIntMap<java.lang.Class<?>> |
descriptorCache |
private java.util.IdentityHashMap<java.lang.Class<?>,Externalizer> |
externalizers |
private IdentityIntMap<java.lang.Object> |
instanceCache |
private int |
instanceSeq |
private static int |
MIN_BUFFER_SIZE |
private SerialObjectOutputStream |
oos |
private static IdentityIntMap<java.lang.Class<?>> |
primitives |
private SerializableClassRegistry |
registry |
private java.util.IdentityHashMap<java.lang.Object,java.lang.Object> |
replacementCache |
classExternalizerFactory, classResolver, classTable, configuredVersion, exceptionListener, objectPreResolver, objectResolver, objectTable, serializabilityChecker, streamHeaderbufferbyteOutputTC_CLASSTABLEDESC, TC_OBJECTTABLEbaseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING| Constructor and Description |
|---|
SerialMarshaller(AbstractMarshallerFactory marshallerFactory,
SerializableClassRegistry registry,
MarshallingConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearClassCache()
Discard the class cache.
|
void |
clearInstanceCache()
Discard the instance cache.
|
private SerialObjectOutputStream |
createObjectOutputStream() |
private void |
doEndBlock() |
protected void |
doWriteFields(SerializableClass info,
java.lang.Object obj) |
protected void |
doWriteObject(java.lang.Object orig,
boolean unshared)
Implementation of the actual object-writing method.
|
void |
finish()
Finish writing to a stream.
|
void |
flush() |
private SerialObjectOutputStream |
getObjectOutputStream() |
private static java.lang.String |
getSignature(java.lang.Class<?> type) |
void |
start(ByteOutput byteOutput)
Begin writing to a stream.
|
private void |
writeClassDescFor(java.lang.Class<?> forClass) |
private void |
writeNewClassDescFor(java.lang.Class<?> forClass) |
private void |
writeNewPlainClassDesc(java.lang.Class<?> forClass) |
private void |
writeNewProxyClassDesc(java.lang.Class<?> forClass) |
(package private) void |
writeNoBlockFlush(byte[] bytes,
int off,
int len) |
private void |
writeSerialData(java.lang.Class<?> objClass,
java.lang.Object obj) |
close, writeObject, writeObjectUnsharedshallowFlush, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwriteObjectUnsharedwriteBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFwrite, write, writeprivate static final int MIN_BUFFER_SIZE
private final SerializableClassRegistry registry
private final IdentityIntMap<java.lang.Object> instanceCache
private final IdentityIntMap<java.lang.Class<?>> descriptorCache
private final java.util.IdentityHashMap<java.lang.Object,java.lang.Object> replacementCache
private final java.util.IdentityHashMap<java.lang.Class<?>,Externalizer> externalizers
private final int bufferSize
private SerialObjectOutputStream oos
private BlockMarshaller blockMarshaller
private int instanceSeq
private final java.security.PrivilegedExceptionAction<SerialObjectOutputStream> createObjectOutputStreamAction
private static final IdentityIntMap<java.lang.Class<?>> primitives
SerialMarshaller(AbstractMarshallerFactory marshallerFactory, SerializableClassRegistry registry, MarshallingConfiguration configuration) throws java.io.IOException
java.io.IOExceptionprotected void doWriteObject(java.lang.Object orig,
boolean unshared)
throws java.io.IOException
AbstractObjectOutputdoWriteObject in class AbstractObjectOutputorig - the object to writeunshared - true if the instance is unshared, false if it is sharedjava.io.IOException - if an I/O error occursprivate void writeSerialData(java.lang.Class<?> objClass,
java.lang.Object obj)
throws java.io.IOException
java.io.IOExceptionprivate SerialObjectOutputStream createObjectOutputStream() throws java.io.IOException
java.io.IOExceptionprivate SerialObjectOutputStream getObjectOutputStream() throws java.io.IOException
java.io.IOExceptionprotected void doWriteFields(SerializableClass info, java.lang.Object obj) throws java.io.IOException
java.io.IOExceptionprivate void writeClassDescFor(java.lang.Class<?> forClass)
throws java.io.IOException
java.io.IOExceptionprivate void writeNewClassDescFor(java.lang.Class<?> forClass)
throws java.io.IOException
java.io.IOExceptionprivate void writeNewProxyClassDesc(java.lang.Class<?> forClass)
throws java.io.IOException
java.io.IOExceptionprivate void writeNewPlainClassDesc(java.lang.Class<?> forClass)
throws java.io.IOException
java.io.IOExceptionprivate void doEndBlock()
throws java.io.IOException
java.io.IOExceptionprivate static java.lang.String getSignature(java.lang.Class<?> type)
public void clearInstanceCache()
throws java.io.IOException
MarshallerclearInstanceCache in interface Marshallerjava.io.IOException - if an error occurspublic void clearClassCache()
throws java.io.IOException
MarshallerclearClassCache in interface 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 occurspublic void finish()
throws java.io.IOException
AbstractMarshallerSimpleDataOutput.start(ByteOutput) method is again invoked.finish in interface Marshallerfinish in class AbstractMarshallerjava.io.IOException - if an error occurspublic void flush()
throws java.io.IOException
SimpleDataOutputflush in interface java.io.Flushableflush in interface java.io.ObjectOutputflush in class SimpleDataOutputjava.io.IOExceptionvoid writeNoBlockFlush(byte[] bytes,
int off,
int len)
throws java.io.IOException
java.io.IOException