Package org.jboss.marshalling
Class MarshallerObjectOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ObjectOutputStream
-
- org.jboss.marshalling.MarshallerObjectOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.DataOutput,java.io.Flushable,java.io.ObjectOutput,java.io.ObjectStreamConstants,java.lang.AutoCloseable,ByteOutput
- Direct Known Subclasses:
RiverObjectOutputStream,SerializingCloner.StepObjectOutputStream,SerialObjectOutputStream
public abstract class MarshallerObjectOutputStream extends java.io.ObjectOutputStream implements ByteOutput
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 implementingSerializable.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.
-
-
Field Summary
Fields Modifier and Type Field Description private Marshalleroutput-
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
Constructors Modifier Constructor Description protectedMarshallerObjectOutputStream(Marshaller output)Construct a new instance that delegates to the given marshaller.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidannotateClass(java.lang.Class<?> cl)protected voidannotateProxyClass(java.lang.Class<?> cl)voidclose()abstract voiddefaultWriteObject()protected voiddrain()protected booleanenableReplaceObject(boolean enable)voidflush()abstract java.io.ObjectOutputStream.PutFieldputFields()protected java.lang.ObjectreplaceObject(java.lang.Object obj)voidreset()voiduseProtocolVersion(int version)voidwrite(byte[] buf)Write all the bytes from the given array to the stream.voidwrite(byte[] buf, int off, int len)Write some of the bytes from the given array to the stream.voidwrite(int val)Writes to the output stream the eight low-order bits of the argumentb.voidwriteBoolean(boolean val)voidwriteByte(int val)voidwriteBytes(java.lang.String str)voidwriteChar(int val)voidwriteChars(java.lang.String str)protected voidwriteClassDescriptor(java.io.ObjectStreamClass desc)voidwriteDouble(double val)abstract voidwriteFields()voidwriteFloat(float val)voidwriteInt(int val)voidwriteLong(long val)protected voidwriteObjectOverride(java.lang.Object obj)voidwriteShort(int val)protected voidwriteStreamHeader()voidwriteUnshared(java.lang.Object obj)voidwriteUTF(java.lang.String str)
-
-
-
Field Detail
-
output
private final Marshaller output
-
-
Constructor Detail
-
MarshallerObjectOutputStream
protected MarshallerObjectOutputStream(Marshaller output) throws java.io.IOException, java.lang.SecurityException
Construct a new instance that delegates to the given marshaller.- Parameters:
output- the delegate marshaller- Throws:
java.io.IOException- if an I/O error occursjava.lang.SecurityException- if the caller does not have permission to construct an instance of this class
-
-
Method Detail
-
writeObjectOverride
protected void writeObjectOverride(java.lang.Object obj) throws java.io.IOException- Overrides:
writeObjectOverridein classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeUnshared
public void writeUnshared(java.lang.Object obj) throws java.io.IOException- Overrides:
writeUnsharedin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
write
public void write(int val) throws java.io.IOExceptionWrites to the output stream the eight low-order bits of the argumentb. The 24 high-order bits ofbare ignored.- Specified by:
writein interfaceByteOutput- Specified by:
writein interfacejava.io.DataOutput- Specified by:
writein interfacejava.io.ObjectOutput- Overrides:
writein classjava.io.ObjectOutputStream- Parameters:
val- the byte to write- Throws:
java.io.IOException- if an error occurs
-
write
public void write(byte[] buf) throws java.io.IOExceptionWrite all the bytes from the given array to the stream.- Specified by:
writein interfaceByteOutput- Specified by:
writein interfacejava.io.DataOutput- Specified by:
writein interfacejava.io.ObjectOutput- Overrides:
writein classjava.io.ObjectOutputStream- Parameters:
buf- the byte array- Throws:
java.io.IOException- if an error occurs
-
write
public void write(byte[] buf, int off, int len) throws java.io.IOExceptionWrite some of the bytes from the given array to the stream.- Specified by:
writein interfaceByteOutput- Specified by:
writein interfacejava.io.DataOutput- Specified by:
writein interfacejava.io.ObjectOutput- Overrides:
writein classjava.io.ObjectOutputStream- Parameters:
buf- the byte arrayoff- the index to start writing fromlen- the number of bytes to write- Throws:
java.io.IOException- if an error occurs
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Specified by:
flushin interfacejava.io.ObjectOutput- Overrides:
flushin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeBoolean
public void writeBoolean(boolean val) throws java.io.IOException- Specified by:
writeBooleanin interfacejava.io.DataOutput- Overrides:
writeBooleanin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeByte
public void writeByte(int val) throws java.io.IOException- Specified by:
writeBytein interfacejava.io.DataOutput- Overrides:
writeBytein classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeShort
public void writeShort(int val) throws java.io.IOException- Specified by:
writeShortin interfacejava.io.DataOutput- Overrides:
writeShortin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeChar
public void writeChar(int val) throws java.io.IOException- Specified by:
writeCharin interfacejava.io.DataOutput- Overrides:
writeCharin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeInt
public void writeInt(int val) throws java.io.IOException- Specified by:
writeIntin interfacejava.io.DataOutput- Overrides:
writeIntin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeLong
public void writeLong(long val) throws java.io.IOException- Specified by:
writeLongin interfacejava.io.DataOutput- Overrides:
writeLongin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeFloat
public void writeFloat(float val) throws java.io.IOException- Specified by:
writeFloatin interfacejava.io.DataOutput- Overrides:
writeFloatin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeDouble
public void writeDouble(double val) throws java.io.IOException- Specified by:
writeDoublein interfacejava.io.DataOutput- Overrides:
writeDoublein classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeBytes
public void writeBytes(java.lang.String str) throws java.io.IOException- Specified by:
writeBytesin interfacejava.io.DataOutput- Overrides:
writeBytesin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeChars
public void writeChars(java.lang.String str) throws java.io.IOException- Specified by:
writeCharsin interfacejava.io.DataOutput- Overrides:
writeCharsin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeUTF
public void writeUTF(java.lang.String str) throws java.io.IOException- Specified by:
writeUTFin interfacejava.io.DataOutput- Overrides:
writeUTFin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
reset
public final void reset() throws java.io.IOException- Overrides:
resetin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
close
public final void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacejava.io.ObjectOutput- Overrides:
closein classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
useProtocolVersion
public final void useProtocolVersion(int version) throws java.io.IOException- Overrides:
useProtocolVersionin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
annotateClass
protected final void annotateClass(java.lang.Class<?> cl) throws java.io.IOException- Overrides:
annotateClassin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
annotateProxyClass
protected final void annotateProxyClass(java.lang.Class<?> cl) throws java.io.IOException- Overrides:
annotateProxyClassin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
replaceObject
protected final java.lang.Object replaceObject(java.lang.Object obj) throws java.io.IOException- Overrides:
replaceObjectin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
enableReplaceObject
protected final boolean enableReplaceObject(boolean enable) throws java.lang.SecurityException- Overrides:
enableReplaceObjectin classjava.io.ObjectOutputStream- Throws:
java.lang.SecurityException
-
writeStreamHeader
protected final void writeStreamHeader() throws java.io.IOException- Overrides:
writeStreamHeaderin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeClassDescriptor
protected final void writeClassDescriptor(java.io.ObjectStreamClass desc) throws java.io.IOException- Overrides:
writeClassDescriptorin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
drain
protected final void drain() throws java.io.IOException- Overrides:
drainin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
writeFields
public abstract void writeFields() throws java.io.IOException- Overrides:
writeFieldsin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
putFields
public abstract java.io.ObjectOutputStream.PutField putFields() throws java.io.IOException- Overrides:
putFieldsin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
defaultWriteObject
public abstract void defaultWriteObject() throws java.io.IOException- Overrides:
defaultWriteObjectin classjava.io.ObjectOutputStream- Throws:
java.io.IOException
-
-