Top Fields Constructors Methods
org.jboss.marshalling.river

pack-priv Class RiverObjectOutputStream

extends MarshallerObjectOutputStream
Class Inheritance
Imports
org.jboss.marshalling.MarshallerObjectOutputStream, .Marshaller, org.jboss.marshalling.util.BooleanFieldPutter, .ByteFieldPutter, .CharFieldPutter, .DoubleFieldPutter, .FloatFieldPutter, .IntFieldPutter, .LongFieldPutter, .ShortFieldPutter, .ObjectFieldPutter, .FieldPutter, org.jboss.marshalling.reflect.SerializableField, .SerializableClass, java.io.IOException, .NotActiveException

Field Summary

Modifier and TypeField and Description
private Object
private final RiverMarshaller
private static final int
private static final int
private RiverPutField
private SerializableClass
private int
private static final int

Constructor Summary

AccessConstructor and Description
protected
RiverObjectOutputStream(final Marshaller delegateMarshaller, final RiverMarshaller marshaller)

Method Summary

Modifier and TypeMethod and Description
private void
private boolean
compareAndSetState(int expect, int set)

public void
defaultWriteObject()

Implements abstract org.jboss.marshalling.MarshallerObjectOutputStream.defaultWriteObject.

Write the non-static and non-transient fields of the current class to this stream.
protected void
finish(int restoreState)

protected void
private int
getAndSetState(int set)

public ObjectOutputStream.PutField
putFields()

Implements abstract org.jboss.marshalling.MarshallerObjectOutputStream.putFields.

Retrieve the object used to buffer persistent fields to be written to the stream.
protected int
protected SerializableClass
swapClass(SerializableClass newSerializableClass)

protected Object
public void
write(final int
the byte to write
val
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write, java.io.ObjectOutput.write.

Writes to the output stream the eight low-order bits of the argument b.
public void
write(final byte[]
the byte array
buf
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write, java.io.ObjectOutput.write.

Write all the bytes from the given array to the stream.
public void
write(final byte[]
the byte array
buf
,
final int
the index to start writing from
off
,
final int
the number of bytes to write
len
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write, java.io.ObjectOutput.write.

Write some of the bytes from the given array to the stream.
public void
writeBoolean(final boolean
the boolean to be written
val
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeBoolean.

Implements java.io.DataOutput.writeBoolean.

Writes a boolean.
public void
writeByte(final int
the byte value to be written
val
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeByte.

Implements java.io.DataOutput.writeByte.

Writes an 8-bit byte.
public void
writeBytes(final String
the String of bytes to be written
str
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeBytes.

Implements java.io.DataOutput.writeBytes.

Writes a String as a sequence of bytes.
public void
writeChar(final int
the char value to be written
val
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeChar.

Implements java.io.DataOutput.writeChar.

Writes a 16-bit char.
public void
writeChars(final String
the String of chars to be written
str
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeChars.

Implements java.io.DataOutput.writeChars.

Writes a String as a sequence of chars.
public void
writeDouble(final double
the double value to be written
val
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeDouble.

Implements java.io.DataOutput.writeDouble.

Writes a 64-bit double.
public void
writeFields()

Implements abstract org.jboss.marshalling.MarshallerObjectOutputStream.writeFields.

Write the buffered fields to the stream.
public void
writeFloat(final float
the float value to be written
val
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeFloat.

Implements java.io.DataOutput.writeFloat.

Writes a 32-bit float.
public void
writeInt(final int
the integer value to be written
val
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeInt.

Implements java.io.DataOutput.writeInt.

Writes a 32-bit int.
public void
writeLong(final long
the long value to be written
val
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeLong.

Implements java.io.DataOutput.writeLong.

Writes a 64-bit long.
protected void
writeObjectOverride(final Object
object to be written to the underlying stream
obj
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride.

Method used by subclasses to override the default writeObject method.
public void
writeShort(final int
the short value to be written
val
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeShort.

Implements java.io.DataOutput.writeShort.

Writes a 16-bit short.
public void
writeUnshared(final Object
object to write to stream
obj
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeUnshared.

Writes an "unshared" object to the ObjectOutputStream.
public void
writeUTF(final String
the String to be written
str
)

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeUTF.

Implements java.io.DataOutput.writeUTF.

Primitive data write of this String in modified UTF-8 format.
Inherited from org.jboss.marshalling.MarshallerObjectOutputStream:
annotateClassannotateProxyClassclosedrainenableReplaceObjectflushreplaceObjectresetuseProtocolVersionwriteClassDescriptorwriteStreamHeader

Field Detail

currentback to summary
private Object current
marshallerback to summary
private final RiverMarshaller marshaller
OFFback to summary
private static final int OFF
ONback to summary
private static final int ON
putFieldback to summary
private RiverPutField putField
serializableClassback to summary
private SerializableClass serializableClass
stateback to summary
private int state
UNWRITTEN_FIELDSback to summary
private static final int UNWRITTEN_FIELDS

Constructor Detail

RiverObjectOutputStreamback to summary
protected RiverObjectOutputStream(final Marshaller delegateMarshaller, final RiverMarshaller marshaller) throws IOException, SecurityException

Method Detail

checkStateback to summary
private void checkState() throws IOException
compareAndSetStateback to summary
private boolean compareAndSetState(int expect, int set)
defaultWriteObjectback to summary
public void defaultWriteObject() throws IOException

Implements abstract org.jboss.marshalling.MarshallerObjectOutputStream.defaultWriteObject.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.defaultWriteObject.

Write the non-static and non-transient fields of the current class to this stream. This may only be called from the writeObject method of the class being serialized. It will throw the NotActiveException if it is called otherwise.

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.defaultWriteObject.

if I/O errors occur while writing to the underlying OutputStream

finishback to summary
protected void finish(int restoreState) throws IOException
fullResetback to summary
protected void fullReset()
getAndSetStateback to summary
private int getAndSetState(int set)
putFieldsback to summary
public ObjectOutputStream.PutField putFields() throws IOException

Implements abstract org.jboss.marshalling.MarshallerObjectOutputStream.putFields.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.putFields.

Retrieve the object used to buffer persistent fields to be written to the stream. The fields will be written to the stream when writeFields method is called.

Returns:ObjectOutputStream.PutField

Doc from java.io.ObjectOutputStream.putFields.

an instance of the class Putfield that holds the serializable fields

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.putFields.

if I/O errors occur

startback to summary
protected int start() throws IOException
swapClassback to summary
protected SerializableClass swapClass(SerializableClass newSerializableClass)
swapCurrentback to summary
protected Object swapCurrent(Object current)
writeback to summary
public void write(final int val) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write, java.io.ObjectOutput.write.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.write.

Writes to the output stream the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Parameters
val:int

Doc from org.jboss.marshalling.ByteOutput.write.

the byte to write

Exceptions
IOException:

Doc from org.jboss.marshalling.ByteOutput.write.

if an error occurs

writeback to summary
public void write(final byte[] buf) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write, java.io.ObjectOutput.write.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.write.

Write all the bytes from the given array to the stream.

Parameters
buf:byte[]

Doc from org.jboss.marshalling.ByteOutput.write.

the byte array

Exceptions
IOException:

Doc from org.jboss.marshalling.ByteOutput.write.

if an error occurs

writeback to summary
public void write(final byte[] buf, final int off, final int len) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.write.

Implements org.jboss.marshalling.ByteOutput.write, java.io.ObjectOutput.write.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.write.

Write some of the bytes from the given array to the stream.

Parameters
buf:byte[]

Doc from org.jboss.marshalling.ByteOutput.write.

the byte array

off:int

Doc from org.jboss.marshalling.ByteOutput.write.

the index to start writing from

len:int

Doc from org.jboss.marshalling.ByteOutput.write.

the number of bytes to write

Exceptions
IOException:

Doc from org.jboss.marshalling.ByteOutput.write.

if an error occurs

writeBooleanback to summary
public void writeBoolean(final boolean val) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeBoolean.

Implements java.io.DataOutput.writeBoolean.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeBoolean.

Writes a boolean.

Parameters
val:boolean

Doc from java.io.ObjectOutputStream.writeBoolean.

the boolean to be written

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeBoolean.

if I/O errors occur while writing to the underlying stream

writeByteback to summary
public void writeByte(final int val) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeByte.

Implements java.io.DataOutput.writeByte.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeByte.

Writes an 8-bit byte.

Parameters
val:int

Doc from java.io.ObjectOutputStream.writeByte.

the byte value to be written

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeByte.

if I/O errors occur while writing to the underlying stream

writeBytesback to summary
public void writeBytes(final String str) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeBytes.

Implements java.io.DataOutput.writeBytes.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeBytes.

Writes a String as a sequence of bytes.

Parameters
str:String

Doc from java.io.ObjectOutputStream.writeBytes.

the String of bytes to be written

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeBytes.

if I/O errors occur while writing to the underlying stream

writeCharback to summary
public void writeChar(final int val) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeChar.

Implements java.io.DataOutput.writeChar.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeChar.

Writes a 16-bit char.

Parameters
val:int

Doc from java.io.ObjectOutputStream.writeChar.

the char value to be written

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeChar.

if I/O errors occur while writing to the underlying stream

writeCharsback to summary
public void writeChars(final String str) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeChars.

Implements java.io.DataOutput.writeChars.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeChars.

Writes a String as a sequence of chars.

Parameters
str:String

Doc from java.io.ObjectOutputStream.writeChars.

the String of chars to be written

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeChars.

if I/O errors occur while writing to the underlying stream

writeDoubleback to summary
public void writeDouble(final double val) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeDouble.

Implements java.io.DataOutput.writeDouble.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeDouble.

Writes a 64-bit double.

Parameters
val:double

Doc from java.io.ObjectOutputStream.writeDouble.

the double value to be written

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeDouble.

if I/O errors occur while writing to the underlying stream

writeFieldsback to summary
public void writeFields() throws IOException

Implements abstract org.jboss.marshalling.MarshallerObjectOutputStream.writeFields.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeFields.

Write the buffered fields to the stream.

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeFields.

if I/O errors occur while writing to the underlying stream

writeFloatback to summary
public void writeFloat(final float val) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeFloat.

Implements java.io.DataOutput.writeFloat.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeFloat.

Writes a 32-bit float.

Parameters
val:float

Doc from java.io.ObjectOutputStream.writeFloat.

the float value to be written

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeFloat.

if I/O errors occur while writing to the underlying stream

writeIntback to summary
public void writeInt(final int val) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeInt.

Implements java.io.DataOutput.writeInt.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeInt.

Writes a 32-bit int.

Parameters
val:int

Doc from java.io.ObjectOutputStream.writeInt.

the integer value to be written

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeInt.

if I/O errors occur while writing to the underlying stream

writeLongback to summary
public void writeLong(final long val) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeLong.

Implements java.io.DataOutput.writeLong.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeLong.

Writes a 64-bit long.

Parameters
val:long

Doc from java.io.ObjectOutputStream.writeLong.

the long value to be written

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeLong.

if I/O errors occur while writing to the underlying stream

writeObjectOverrideback to summary
protected void writeObjectOverride(final Object obj) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride.

Method used by subclasses to override the default writeObject method. This method is called by trusted subclasses of ObjectOutputStream that constructed ObjectOutputStream using the protected no-arg constructor. The subclass is expected to provide an override method with the modifier "final".

Parameters
obj:Object

Doc from java.io.ObjectOutputStream.writeObjectOverride.

object to be written to the underlying stream

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeObjectOverride.

if there are I/O errors while writing to the underlying stream

writeShortback to summary
public void writeShort(final int val) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeShort.

Implements java.io.DataOutput.writeShort.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeShort.

Writes a 16-bit short.

Parameters
val:int

Doc from java.io.ObjectOutputStream.writeShort.

the short value to be written

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeShort.

if I/O errors occur while writing to the underlying stream

writeUnsharedback to summary
public void writeUnshared(final Object obj) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeUnshared.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeUnshared.

Writes an "unshared" object to the ObjectOutputStream. This method is identical to writeObject, except that it always writes the given object as a new, unique object in the stream (as opposed to a back-reference pointing to a previously serialized instance). Specifically:

  • An object written via writeUnshared is always serialized in the same manner as a newly appearing object (an object that has not been written to the stream yet), regardless of whether or not the object has been written previously.
  • If writeObject is used to write an object that has been previously written with writeUnshared, the previous writeUnshared operation is treated as if it were a write of a separate object. In other words, ObjectOutputStream will never generate back-references to object data written by calls to writeUnshared.
While writing an object via writeUnshared does not in itself guarantee a unique reference to the object when it is deserialized, it allows a single object to be defined multiple times in a stream, so that multiple calls to readUnshared by the receiver will not conflict. Note that the rules described above only apply to the base-level object written with writeUnshared, and not to any transitively referenced sub-objects in the object graph to be serialized.

ObjectOutputStream subclasses which override this method can only be constructed in security contexts possessing the "enableSubclassImplementation" SerializablePermission; any attempt to instantiate such a subclass without this permission will cause a SecurityException to be thrown.

Parameters
obj:Object

Doc from java.io.ObjectOutputStream.writeUnshared.

object to write to stream

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeUnshared.

if an I/O error occurs during serialization

writeUTFback to summary
public void writeUTF(final String str) throws IOException

Overrides org.jboss.marshalling.MarshallerObjectOutputStream.writeUTF.

Implements java.io.DataOutput.writeUTF.

Doc from org.jboss.marshalling.MarshallerObjectOutputStream.writeUTF.

Primitive data write of this String in modified UTF-8 format. Note that there is a significant difference between writing a String into the stream as primitive data or as an Object. A String instance written by writeObject is written into the stream as a String initially. Future writeObject() calls write references to the string into the stream.

Parameters
str:String

Doc from java.io.ObjectOutputStream.writeUTF.

the String to be written

Exceptions
IOException:

Doc from java.io.ObjectOutputStream.writeUTF.

if I/O errors occur while writing to the underlying stream