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
public abstract class MarshallerObjectOutputStream extends 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.io.ObjectOutputStream
ObjectOutputStream.PutField
-
-
Field Summary
-
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(Class<?> cl)protected voidannotateProxyClass(Class<?> cl)voidclose()abstract voiddefaultWriteObject()protected voiddrain()protected booleanenableReplaceObject(boolean enable)voidflush()abstract ObjectOutputStream.PutFieldputFields()protected ObjectreplaceObject(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(String str)voidwriteChar(int val)voidwriteChars(String str)protected voidwriteClassDescriptor(ObjectStreamClass desc)voidwriteDouble(double val)abstract voidwriteFields()voidwriteFloat(float val)voidwriteInt(int val)voidwriteLong(long val)protected voidwriteObjectOverride(Object obj)voidwriteShort(int val)protected voidwriteStreamHeader()voidwriteUnshared(Object obj)voidwriteUTF(String str)-
Methods inherited from class java.io.ObjectOutputStream
writeObject
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
MarshallerObjectOutputStream
protected MarshallerObjectOutputStream(Marshaller output) throws IOException, SecurityException
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 Detail
-
writeObjectOverride
protected void writeObjectOverride(Object obj) throws IOException
- Overrides:
writeObjectOverridein classObjectOutputStream- Throws:
IOException
-
writeUnshared
public void writeUnshared(Object obj) throws IOException
- Overrides:
writeUnsharedin classObjectOutputStream- Throws:
IOException
-
write
public void write(int val) throws 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 interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classObjectOutputStream- Parameters:
val- the byte to write- Throws:
IOException- if an error occurs
-
write
public void write(byte[] buf) throws IOExceptionWrite all the bytes from the given array to the stream.- Specified by:
writein interfaceByteOutput- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classObjectOutputStream- Parameters:
buf- the byte array- Throws:
IOException- if an error occurs
-
write
public void write(byte[] buf, int off, int len) throws IOExceptionWrite some of the bytes from the given array to the stream.- Specified by:
writein interfaceByteOutput- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein 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
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceObjectOutput- Overrides:
flushin classObjectOutputStream- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean val) throws IOException- Specified by:
writeBooleanin interfaceDataOutput- Overrides:
writeBooleanin classObjectOutputStream- Throws:
IOException
-
writeByte
public void writeByte(int val) throws IOException- Specified by:
writeBytein interfaceDataOutput- Overrides:
writeBytein classObjectOutputStream- Throws:
IOException
-
writeShort
public void writeShort(int val) throws IOException- Specified by:
writeShortin interfaceDataOutput- Overrides:
writeShortin classObjectOutputStream- Throws:
IOException
-
writeChar
public void writeChar(int val) throws IOException- Specified by:
writeCharin interfaceDataOutput- Overrides:
writeCharin classObjectOutputStream- Throws:
IOException
-
writeInt
public void writeInt(int val) throws IOException- Specified by:
writeIntin interfaceDataOutput- Overrides:
writeIntin classObjectOutputStream- Throws:
IOException
-
writeLong
public void writeLong(long val) throws IOException- Specified by:
writeLongin interfaceDataOutput- Overrides:
writeLongin classObjectOutputStream- Throws:
IOException
-
writeFloat
public void writeFloat(float val) throws IOException- Specified by:
writeFloatin interfaceDataOutput- Overrides:
writeFloatin classObjectOutputStream- Throws:
IOException
-
writeDouble
public void writeDouble(double val) throws IOException- Specified by:
writeDoublein interfaceDataOutput- Overrides:
writeDoublein classObjectOutputStream- Throws:
IOException
-
writeBytes
public void writeBytes(String str) throws IOException
- Specified by:
writeBytesin interfaceDataOutput- Overrides:
writeBytesin classObjectOutputStream- Throws:
IOException
-
writeChars
public void writeChars(String str) throws IOException
- Specified by:
writeCharsin interfaceDataOutput- Overrides:
writeCharsin classObjectOutputStream- Throws:
IOException
-
writeUTF
public void writeUTF(String str) throws IOException
- Specified by:
writeUTFin interfaceDataOutput- Overrides:
writeUTFin classObjectOutputStream- Throws:
IOException
-
reset
public final void reset() throws IOException- Overrides:
resetin classObjectOutputStream- Throws:
IOException
-
close
public final void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectOutput- Overrides:
closein classObjectOutputStream- Throws:
IOException
-
useProtocolVersion
public final void useProtocolVersion(int version) throws IOException- Overrides:
useProtocolVersionin classObjectOutputStream- Throws:
IOException
-
annotateClass
protected final void annotateClass(Class<?> cl) throws IOException
- Overrides:
annotateClassin classObjectOutputStream- Throws:
IOException
-
annotateProxyClass
protected final void annotateProxyClass(Class<?> cl) throws IOException
- Overrides:
annotateProxyClassin classObjectOutputStream- Throws:
IOException
-
replaceObject
protected final Object replaceObject(Object obj) throws IOException
- Overrides:
replaceObjectin classObjectOutputStream- Throws:
IOException
-
enableReplaceObject
protected final boolean enableReplaceObject(boolean enable) throws SecurityException- Overrides:
enableReplaceObjectin classObjectOutputStream- Throws:
SecurityException
-
writeStreamHeader
protected final void writeStreamHeader() throws IOException- Overrides:
writeStreamHeaderin classObjectOutputStream- Throws:
IOException
-
writeClassDescriptor
protected final void writeClassDescriptor(ObjectStreamClass desc) throws IOException
- Overrides:
writeClassDescriptorin classObjectOutputStream- Throws:
IOException
-
drain
protected final void drain() throws IOException- Overrides:
drainin classObjectOutputStream- Throws:
IOException
-
writeFields
public abstract void writeFields() throws IOException- Overrides:
writeFieldsin classObjectOutputStream- Throws:
IOException
-
putFields
public abstract ObjectOutputStream.PutField putFields() throws IOException
- Overrides:
putFieldsin classObjectOutputStream- Throws:
IOException
-
defaultWriteObject
public abstract void defaultWriteObject() throws IOException- Overrides:
defaultWriteObjectin classObjectOutputStream- Throws:
IOException
-
-