Package org.jboss.marshalling
Class MarshallerObjectOutputStream
java.lang.Object
java.io.OutputStream
java.io.ObjectOutputStream
org.jboss.marshalling.MarshallerObjectOutputStream
- All Implemented Interfaces:
Closeable
,DataOutput
,Flushable
,ObjectOutput
,ObjectStreamConstants
,AutoCloseable
,ByteOutput
- Direct Known Subclasses:
RiverObjectOutputStream
,SerializingCloner.StepObjectOutputStream
,SerialObjectOutputStream
A marshaller's object output stream. Used by marshallers for compatibility with Java serialization. Instances of
this class may be passed in to the overridden serialization methods for a class implementing
Serializable
.
This class is not part of the marshalling API; rather it is intended for marshaller implementers to make it easier to develop Java serialization-compatible marshallers.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.io.ObjectOutputStream
ObjectOutputStream.PutField
-
Field Summary
FieldsFields 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
ConstructorsModifierConstructorDescriptionprotected
Construct a new instance that delegates to the given marshaller. -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
annotateClass
(Class<?> cl) protected final void
annotateProxyClass
(Class<?> cl) final void
close()
abstract void
protected final void
drain()
protected final boolean
enableReplaceObject
(boolean enable) void
flush()
abstract ObjectOutputStream.PutField
protected final Object
replaceObject
(Object obj) final void
reset()
final void
useProtocolVersion
(int version) void
write
(byte[] buf) Write all the bytes from the given array to the stream.void
write
(byte[] buf, int off, int len) Write some of the bytes from the given array to the stream.void
write
(int val) Writes to the output stream the eight low-order bits of the argumentb
.void
writeBoolean
(boolean val) void
writeByte
(int val) void
writeBytes
(String str) void
writeChar
(int val) void
writeChars
(String str) protected final void
void
writeDouble
(double val) abstract void
void
writeFloat
(float val) void
writeInt
(int val) void
writeLong
(long val) protected void
void
writeShort
(int val) protected final void
void
writeUnshared
(Object obj) void
Methods inherited from class java.io.ObjectOutputStream
writeObject
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
output
-
-
Constructor Details
-
MarshallerObjectOutputStream
Construct a new instance that delegates to the given marshaller.- Parameters:
output
- the delegate marshaller- Throws:
IOException
- if an I/O error occursSecurityException
- if the caller does not have permission to construct an instance of this class
-
-
Method Details
-
writeObjectOverride
- Overrides:
writeObjectOverride
in classObjectOutputStream
- Throws:
IOException
-
write
Writes to the output stream the eight low-order bits of the argumentb
. The 24 high-order bits ofb
are ignored.- Specified by:
write
in interfaceByteOutput
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Overrides:
write
in classObjectOutputStream
- Parameters:
val
- the byte to write- Throws:
IOException
- if an error occurs
-
write
Write all the bytes from the given array to the stream.- Specified by:
write
in interfaceByteOutput
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Overrides:
write
in classObjectOutputStream
- Parameters:
buf
- the byte array- Throws:
IOException
- if an error occurs
-
write
Write some of the bytes from the given array to the stream.- Specified by:
write
in interfaceByteOutput
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Overrides:
write
in classObjectOutputStream
- Parameters:
buf
- the byte arrayoff
- the index to start writing fromlen
- the number of bytes to write- Throws:
IOException
- if an error occurs
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in interfaceObjectOutput
- Overrides:
flush
in classObjectOutputStream
- Throws:
IOException
-
writeBoolean
- Specified by:
writeBoolean
in interfaceDataOutput
- Overrides:
writeBoolean
in classObjectOutputStream
- Throws:
IOException
-
writeByte
- Specified by:
writeByte
in interfaceDataOutput
- Overrides:
writeByte
in classObjectOutputStream
- Throws:
IOException
-
writeShort
- Specified by:
writeShort
in interfaceDataOutput
- Overrides:
writeShort
in classObjectOutputStream
- Throws:
IOException
-
writeChar
- Specified by:
writeChar
in interfaceDataOutput
- Overrides:
writeChar
in classObjectOutputStream
- Throws:
IOException
-
writeInt
- Specified by:
writeInt
in interfaceDataOutput
- Overrides:
writeInt
in classObjectOutputStream
- Throws:
IOException
-
writeLong
- Specified by:
writeLong
in interfaceDataOutput
- Overrides:
writeLong
in classObjectOutputStream
- Throws:
IOException
-
writeFloat
- Specified by:
writeFloat
in interfaceDataOutput
- Overrides:
writeFloat
in classObjectOutputStream
- Throws:
IOException
-
writeDouble
- Specified by:
writeDouble
in interfaceDataOutput
- Overrides:
writeDouble
in classObjectOutputStream
- Throws:
IOException
-
writeBytes
- Specified by:
writeBytes
in interfaceDataOutput
- Overrides:
writeBytes
in classObjectOutputStream
- Throws:
IOException
-
writeChars
- Specified by:
writeChars
in interfaceDataOutput
- Overrides:
writeChars
in classObjectOutputStream
- Throws:
IOException
-
writeUTF
- Specified by:
writeUTF
in interfaceDataOutput
- Overrides:
writeUTF
in classObjectOutputStream
- Throws:
IOException
-
reset
- Overrides:
reset
in classObjectOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectOutput
- Overrides:
close
in classObjectOutputStream
- Throws:
IOException
-
useProtocolVersion
- Overrides:
useProtocolVersion
in classObjectOutputStream
- Throws:
IOException
-
annotateClass
- Overrides:
annotateClass
in classObjectOutputStream
- Throws:
IOException
-
annotateProxyClass
- Overrides:
annotateProxyClass
in classObjectOutputStream
- Throws:
IOException
-
replaceObject
- Overrides:
replaceObject
in classObjectOutputStream
- Throws:
IOException
-
enableReplaceObject
- Overrides:
enableReplaceObject
in classObjectOutputStream
- Throws:
SecurityException
-
writeStreamHeader
- Overrides:
writeStreamHeader
in classObjectOutputStream
- Throws:
IOException
-
writeClassDescriptor
- Overrides:
writeClassDescriptor
in classObjectOutputStream
- Throws:
IOException
-
drain
- Overrides:
drain
in classObjectOutputStream
- Throws:
IOException
-
writeFields
- Overrides:
writeFields
in classObjectOutputStream
- Throws:
IOException
-
putFields
- Overrides:
putFields
in classObjectOutputStream
- Throws:
IOException
-
defaultWriteObject
- Overrides:
defaultWriteObject
in classObjectOutputStream
- Throws:
IOException
-