Package org.jboss.marshalling
Class AbstractMarshaller
java.lang.Object
java.io.OutputStream
org.jboss.marshalling.SimpleByteOutput
org.jboss.marshalling.ByteOutputStream
org.jboss.marshalling.SimpleDataOutput
org.jboss.marshalling.AbstractObjectOutput
org.jboss.marshalling.AbstractMarshaller
- All Implemented Interfaces:
Closeable
,DataOutput
,Flushable
,ObjectOutput
,AutoCloseable
,ByteOutput
,Marshaller
- Direct Known Subclasses:
RiverMarshaller
,SerialMarshaller
An abstract implementation of the
Marshaller
interface. Most of the
write methods delegate directly to the current data output.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClassExternalizerFactory
The configured class externalizer factory.protected final ClassResolver
The configured class resolver.protected final ClassTable
The configured class table.protected final int
The configured version to write.protected final ExceptionListener
The configured exception listener.protected final ObjectResolver
The configured pre object resolver.protected final ObjectResolver
The configured object resolver.protected final ObjectTable
The configured object table.protected final SerializabilityChecker
The configured serializability checker.protected final StreamHeader
The configured stream header.Fields inherited from class org.jboss.marshalling.SimpleDataOutput
buffer, bufferSize
Fields inherited from class org.jboss.marshalling.ByteOutputStream
byteOutput
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractMarshaller
(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration) Construct a new marshaller instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
calcBufferSize
(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration) void
close()
void
finish()
Finish writing to a stream.void
start
(ByteOutput byteOutput) Begin writing to a stream.final void
writeObject
(Object obj) final void
Methods inherited from class org.jboss.marshalling.AbstractObjectOutput
doWriteObject
Methods inherited from class org.jboss.marshalling.SimpleDataOutput
flush, 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
clearClassCache, clearInstanceCache
Methods inherited from interface java.io.ObjectOutput
flush, write, write, write
-
Field Details
-
classExternalizerFactory
The configured class externalizer factory. -
streamHeader
The configured stream header. -
classResolver
The configured class resolver. -
objectResolver
The configured object resolver. -
objectPreResolver
The configured pre object resolver. -
classTable
The configured class table. -
objectTable
The configured object table. -
exceptionListener
The configured exception listener. -
serializabilityChecker
The configured serializability checker. -
configuredVersion
protected final int configuredVersionThe configured version to write.
-
-
Constructor Details
-
AbstractMarshaller
protected AbstractMarshaller(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration) Construct a new marshaller instance.- Parameters:
marshallerFactory
- the marshaller factoryconfiguration
-
-
-
Method Details
-
calcBufferSize
private static int calcBufferSize(AbstractMarshallerFactory marshallerFactory, MarshallingConfiguration configuration) -
start
Begin writing to a stream.- Specified by:
start
in interfaceMarshaller
- Overrides:
start
in classSimpleDataOutput
- Parameters:
byteOutput
- the new stream- Throws:
IOException
- if an error occurs
-
writeObject
- Specified by:
writeObject
in interfaceObjectOutput
- Overrides:
writeObject
in classAbstractObjectOutput
- Throws:
IOException
-
finish
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 classSimpleDataOutput
- Throws:
IOException
- if an error occurs
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectOutput
- Overrides:
close
in classSimpleDataOutput
- Throws:
IOException
-