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.Object
current
private RiverMarshaller
marshaller
private static int
OFF
private static int
ON
private RiverPutField
putField
private SerializableClass
serializableClass
private int
state
private static int
UNWRITTEN_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 protected
RiverObjectOutputStream(Marshaller delegateMarshaller, RiverMarshaller marshaller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkState()
private boolean
compareAndSetState(int expect, int set)
void
defaultWriteObject()
protected void
finish(int restoreState)
protected void
fullReset()
private int
getAndSetState(int set)
java.io.ObjectOutputStream.PutField
putFields()
protected int
start()
protected SerializableClass
swapClass(SerializableClass newSerializableClass)
protected java.lang.Object
swapCurrent(java.lang.Object current)
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(java.lang.String str)
void
writeChar(int val)
void
writeChars(java.lang.String str)
void
writeDouble(double val)
void
writeFields()
void
writeFloat(float val)
void
writeInt(int val)
void
writeLong(long val)
protected void
writeObjectOverride(java.lang.Object obj)
void
writeShort(int val)
void
writeUnshared(java.lang.Object obj)
void
writeUTF(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.IOException
java.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.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeFields
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
putFields
public java.io.ObjectOutputStream.PutField putFields() throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
putFields
in 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.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
defaultWriteObject
in 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.IOException
Description copied from class:MarshallerObjectOutputStream
- Overrides:
writeObjectOverride
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
writeUnshared
public void writeUnshared(java.lang.Object obj) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Overrides:
writeUnshared
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
write
public void write(int val) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
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 interfacejava.io.DataOutput
- Specified by:
write
in interfacejava.io.ObjectOutput
- Overrides:
write
in classMarshallerObjectOutputStream
- Parameters:
val
- the byte to write- Throws:
java.io.IOException
- if an error occurs
-
write
public void write(byte[] buf) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
Write all the bytes from the given array to the stream.- Specified by:
write
in interfaceByteOutput
- Specified by:
write
in interfacejava.io.DataOutput
- Specified by:
write
in interfacejava.io.ObjectOutput
- Overrides:
write
in 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.IOException
Description copied from class:MarshallerObjectOutputStream
Write some of the bytes from the given array to the stream.- Specified by:
write
in interfaceByteOutput
- Specified by:
write
in interfacejava.io.DataOutput
- Specified by:
write
in interfacejava.io.ObjectOutput
- Overrides:
write
in 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.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeBoolean
in interfacejava.io.DataOutput
- Overrides:
writeBoolean
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
writeByte
public void writeByte(int val) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeByte
in interfacejava.io.DataOutput
- Overrides:
writeByte
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
writeShort
public void writeShort(int val) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeShort
in interfacejava.io.DataOutput
- Overrides:
writeShort
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
writeChar
public void writeChar(int val) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeChar
in interfacejava.io.DataOutput
- Overrides:
writeChar
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
writeInt
public void writeInt(int val) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeInt
in interfacejava.io.DataOutput
- Overrides:
writeInt
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
writeLong
public void writeLong(long val) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeLong
in interfacejava.io.DataOutput
- Overrides:
writeLong
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
writeFloat
public void writeFloat(float val) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeFloat
in interfacejava.io.DataOutput
- Overrides:
writeFloat
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
writeDouble
public void writeDouble(double val) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeDouble
in interfacejava.io.DataOutput
- Overrides:
writeDouble
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
writeBytes
public void writeBytes(java.lang.String str) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeBytes
in interfacejava.io.DataOutput
- Overrides:
writeBytes
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
writeChars
public void writeChars(java.lang.String str) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeChars
in interfacejava.io.DataOutput
- Overrides:
writeChars
in classMarshallerObjectOutputStream
- Throws:
java.io.IOException
-
writeUTF
public void writeUTF(java.lang.String str) throws java.io.IOException
Description copied from class:MarshallerObjectOutputStream
- Specified by:
writeUTF
in interfacejava.io.DataOutput
- Overrides:
writeUTF
in 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()
-
-