Package org.jboss.marshalling.serial
Class SerialMarshaller
- All Implemented Interfaces:
Closeable
,DataOutput
,Flushable
,ObjectOutput
,ObjectStreamConstants
,AutoCloseable
,ByteOutput
,Marshaller
,ExtendedObjectStreamConstants
public final class SerialMarshaller
extends AbstractMarshaller
implements Marshaller, ExtendedObjectStreamConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BlockMarshaller
private final int
private final PrivilegedExceptionAction<SerialObjectOutputStream>
private final IdentityIntMap<Class<?>>
private final IdentityHashMap<Class<?>,
Externalizer> private final IdentityIntMap<Object>
private int
private static final int
private SerialObjectOutputStream
private static final IdentityIntMap<Class<?>>
private final SerializableClassRegistry
private final IdentityHashMap<Object,
Object> Fields inherited from class org.jboss.marshalling.AbstractMarshaller
classExternalizerFactory, classResolver, classTable, configuredVersion, exceptionListener, objectPreResolver, objectResolver, objectTable, serializabilityChecker, streamHeader
Fields inherited from class org.jboss.marshalling.SimpleDataOutput
buffer
Fields inherited from class org.jboss.marshalling.ByteOutputStream
byteOutput
Fields inherited from interface org.jboss.marshalling.serial.ExtendedObjectStreamConstants
TC_CLASSTABLEDESC, TC_OBJECTTABLE
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, SERIAL_FILTER_PERMISSION, 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 Summary
ConstructorsConstructorDescriptionSerialMarshaller
(AbstractMarshallerFactory marshallerFactory, SerializableClassRegistry registry, MarshallingConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Discard the class cache.void
Discard the instance cache.private SerialObjectOutputStream
private void
protected void
doWriteFields
(SerializableClass info, Object obj) protected void
doWriteObject
(Object orig, boolean unshared) Implementation of the actual object-writing method.void
finish()
Finish writing to a stream.void
flush()
private SerialObjectOutputStream
private static String
getSignature
(Class<?> type) void
start
(ByteOutput byteOutput) Begin writing to a stream.private void
writeClassDescFor
(Class<?> forClass) private void
writeNewClassDescFor
(Class<?> forClass) private void
writeNewPlainClassDesc
(Class<?> forClass) private void
writeNewProxyClassDesc
(Class<?> forClass) (package private) void
writeNoBlockFlush
(byte[] bytes, int off, int len) private void
writeSerialData
(Class<?> objClass, Object obj) Methods inherited from class org.jboss.marshalling.AbstractMarshaller
close, writeObject, writeObjectUnshared
Methods inherited from class org.jboss.marshalling.SimpleDataOutput
shallowFlush, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
Methods inherited from class java.io.OutputStream
nullOutputStream
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jboss.marshalling.ByteOutput
write, write, write
Methods inherited from interface java.io.DataOutput
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
Methods inherited from interface org.jboss.marshalling.Marshaller
writeObjectUnshared
Methods inherited from interface java.io.ObjectOutput
close, write, write, write, writeObject
-
Field Details
-
MIN_BUFFER_SIZE
private static final int MIN_BUFFER_SIZE- See Also:
-
registry
-
instanceCache
-
descriptorCache
-
replacementCache
-
externalizers
-
bufferSize
private final int bufferSize -
oos
-
blockMarshaller
-
instanceSeq
private int instanceSeq -
createObjectOutputStreamAction
-
primitives
-
-
Constructor Details
-
SerialMarshaller
SerialMarshaller(AbstractMarshallerFactory marshallerFactory, SerializableClassRegistry registry, MarshallingConfiguration configuration) throws IOException - Throws:
IOException
-
-
Method Details
-
doWriteObject
Description copied from class:AbstractObjectOutput
Implementation of the actual object-writing method.- Specified by:
doWriteObject
in classAbstractObjectOutput
- Parameters:
orig
- the object to writeunshared
-true
if the instance is unshared,false
if it is shared- Throws:
IOException
- if an I/O error occurs
-
writeSerialData
- Throws:
IOException
-
createObjectOutputStream
- Throws:
IOException
-
getObjectOutputStream
- Throws:
IOException
-
doWriteFields
- Throws:
IOException
-
writeClassDescFor
- Throws:
IOException
-
writeNewClassDescFor
- Throws:
IOException
-
writeNewProxyClassDesc
- Throws:
IOException
-
writeNewPlainClassDesc
- Throws:
IOException
-
doEndBlock
- Throws:
IOException
-
getSignature
-
clearInstanceCache
Description copied from interface:Marshaller
Discard the instance cache. May also discard the class cache in implementations that do not support separated class and instance caches.- Specified by:
clearInstanceCache
in interfaceMarshaller
- Throws:
IOException
- if an error occurs
-
clearClassCache
Description copied from interface:Marshaller
Discard the class cache. Implicitly also discards the instance cache.- Specified by:
clearClassCache
in interfaceMarshaller
- Throws:
IOException
- if an error occurs
-
start
Description copied from class:AbstractMarshaller
Begin writing to a stream.- Specified by:
start
in interfaceMarshaller
- Overrides:
start
in classAbstractMarshaller
- Parameters:
byteOutput
- the new stream- Throws:
IOException
- if an error occurs
-
finish
Description copied from class:AbstractMarshaller
Finish writing to a stream. The stream is released. No further writing may be done until theSimpleDataOutput.start(ByteOutput)
method is again invoked.- Specified by:
finish
in interfaceMarshaller
- Overrides:
finish
in classAbstractMarshaller
- Throws:
IOException
- if an error occurs
-
flush
Description copied from class:SimpleDataOutput
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in interfaceObjectOutput
- Overrides:
flush
in classSimpleDataOutput
- Throws:
IOException
-
writeNoBlockFlush
- Throws:
IOException
-