Package org.jboss.marshalling.river
Class RiverObjectOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ObjectOutputStream
-
- org.jboss.marshalling.MarshallerObjectOutputStream
-
- org.jboss.marshalling.river.RiverObjectOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.DataOutput,java.io.Flushable,java.io.ObjectOutput,java.io.ObjectStreamConstants,java.lang.AutoCloseable,ByteOutput
public class RiverObjectOutputStream extends MarshallerObjectOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Objectcurrentprivate RiverMarshallermarshallerprivate static intOFFprivate static intONprivate RiverPutFieldputFieldprivate SerializableClassserializableClassprivate intstateprivate static intUNWRITTEN_FIELDS-
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 protectedRiverObjectOutputStream(Marshaller delegateMarshaller, RiverMarshaller marshaller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckState()private booleancompareAndSetState(int expect, int set)voiddefaultWriteObject()protected voidfinish(int restoreState)protected voidfullReset()private intgetAndSetState(int set)java.io.ObjectOutputStream.PutFieldputFields()protected intstart()protected SerializableClassswapClass(SerializableClass newSerializableClass)protected java.lang.ObjectswapCurrent(java.lang.Object current)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)voidwriteDouble(double val)voidwriteFields()voidwriteFloat(float val)voidwriteInt(int val)voidwriteLong(long val)protected voidwriteObjectOverride(java.lang.Object obj)voidwriteShort(int val)voidwriteUnshared(java.lang.Object obj)voidwriteUTF(java.lang.String str)-
Methods inherited from class org.jboss.marshalling.MarshallerObjectOutputStream
annotateClass, annotateProxyClass, close, drain, enableReplaceObject, flush, replaceObject, reset, useProtocolVersion, writeClassDescriptor, writeStreamHeader
-
-
-
-
Field Detail
-
OFF
private static final int OFF
- See Also:
- Constant Field Values
-
UNWRITTEN_FIELDS
private static final int UNWRITTEN_FIELDS
- See Also:
- Constant Field Values
-
ON
private static final int ON
- See Also:
- Constant Field Values
-
marshaller
private final RiverMarshaller marshaller
-
state
private int state
-
putField
private RiverPutField putField
-
serializableClass
private SerializableClass serializableClass
-
current
private java.lang.Object current
-
-
Constructor Detail
-
RiverObjectOutputStream
protected RiverObjectOutputStream(Marshaller delegateMarshaller, RiverMarshaller marshaller) throws java.io.IOException, java.lang.SecurityException
- Throws:
java.io.IOExceptionjava.lang.SecurityException
-
-
Method Detail
-
compareAndSetState
private boolean compareAndSetState(int expect, int set)
-
getAndSetState
private int getAndSetState(int set)
-
writeFields
public void writeFields() throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeFieldsin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
putFields
public java.io.ObjectOutputStream.PutField putFields() throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
putFieldsin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
swapClass
protected SerializableClass swapClass(SerializableClass newSerializableClass)
-
swapCurrent
protected java.lang.Object swapCurrent(java.lang.Object current)
-
defaultWriteObject
public void defaultWriteObject() throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
defaultWriteObjectin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
start
protected int start() throws java.io.IOException- Throws:
java.io.IOException
-
writeObjectOverride
protected void writeObjectOverride(java.lang.Object obj) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Overrides:
writeObjectOverridein classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
writeUnshared
public void writeUnshared(java.lang.Object obj) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Overrides:
writeUnsharedin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
write
public void write(int val) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStreamWrites 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 classMarshallerObjectOutputStream- Parameters:
val- the byte to write- Throws:
java.io.IOException- if an error occurs
-
write
public void write(byte[] buf) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStreamWrite 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 classMarshallerObjectOutputStream- 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.IOExceptionDescription copied from class:MarshallerObjectOutputStreamWrite 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 classMarshallerObjectOutputStream- 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
-
writeBoolean
public void writeBoolean(boolean val) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeBooleanin interfacejava.io.DataOutput- Overrides:
writeBooleanin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
writeByte
public void writeByte(int val) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeBytein interfacejava.io.DataOutput- Overrides:
writeBytein classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
writeShort
public void writeShort(int val) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeShortin interfacejava.io.DataOutput- Overrides:
writeShortin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
writeChar
public void writeChar(int val) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeCharin interfacejava.io.DataOutput- Overrides:
writeCharin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
writeInt
public void writeInt(int val) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeIntin interfacejava.io.DataOutput- Overrides:
writeIntin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
writeLong
public void writeLong(long val) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeLongin interfacejava.io.DataOutput- Overrides:
writeLongin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
writeFloat
public void writeFloat(float val) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeFloatin interfacejava.io.DataOutput- Overrides:
writeFloatin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
writeDouble
public void writeDouble(double val) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeDoublein interfacejava.io.DataOutput- Overrides:
writeDoublein classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
writeBytes
public void writeBytes(java.lang.String str) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeBytesin interfacejava.io.DataOutput- Overrides:
writeBytesin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
writeChars
public void writeChars(java.lang.String str) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeCharsin interfacejava.io.DataOutput- Overrides:
writeCharsin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
writeUTF
public void writeUTF(java.lang.String str) throws java.io.IOExceptionDescription copied from class:MarshallerObjectOutputStream- Specified by:
writeUTFin interfacejava.io.DataOutput- Overrides:
writeUTFin classMarshallerObjectOutputStream- Throws:
java.io.IOException
-
finish
protected void finish(int restoreState) throws java.io.IOException- Throws:
java.io.IOException
-
checkState
private void checkState() throws java.io.IOException- Throws:
java.io.IOException
-
fullReset
protected void fullReset()
-
-