Top Description Constructors Methods
javassist.util.proxy

public Class ProxyObjectOutputStream

extends ObjectOutputStream
Class Inheritance
Imports
java.io.IOException, .ObjectOutputStream, .ObjectStreamClass, .OutputStream

An input stream class which knows how to serialize proxies created via ProxyFactory. It must be used when serialising proxies created from a proxy factory configured with ProxyFactory#useWriteReplace set to false. Subsequent deserialization of the serialized data must employ a ProxyObjectInputStream
Author
Andrew Dinn

Constructor Summary

AccessConstructor and Description
public
ProxyObjectOutputStream(OutputStream out)

create an output stream which can be used to serialize an object graph which includes proxies created using class ProxyFactory

Method Summary

Modifier and TypeMethod and Description
protected void
writeClassDescriptor(ObjectStreamClass
class descriptor to write to the stream
desc
)

Overrides java.io.ObjectOutputStream.writeClassDescriptor.

Write the specified class descriptor to the ObjectOutputStream.

Inherited from java.io.ObjectOutputStream:
annotateClassannotateProxyClassclosedefaultWriteObjectdrainenableReplaceObjectflushputFieldsreplaceObjectresetuseProtocolVersionwritewritewritewriteBooleanwriteBytewriteByteswriteCharwriteCharswriteDoublewriteFieldswriteFloatwriteIntwriteLongwriteObjectwriteObjectOverridewriteShortwriteStreamHeaderwriteUnsharedwriteUTF

Constructor Detail

ProxyObjectOutputStreamback to summary
public ProxyObjectOutputStream(OutputStream out) throws IOException

create an output stream which can be used to serialize an object graph which includes proxies created using class ProxyFactory

Exceptions
IOException:
whenever ObjectOutputStream would also do so
SecurityException:
whenever ObjectOutputStream would also do so
NullPointerException:
if out is null

Method Detail

writeClassDescriptorback to summary
protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException

Overrides java.io.ObjectOutputStream.writeClassDescriptor.

Doc from java.io.ObjectOutputStream.writeClassDescriptor.

Write the specified class descriptor to the ObjectOutputStream. Class descriptors are used to identify the classes of objects written to the stream. Subclasses of ObjectOutputStream may override this method to customize the way in which class descriptors are written to the serialization stream. The corresponding method in ObjectInputStream, readClassDescriptor, should then be overridden to reconstitute the class descriptor from its custom stream representation. By default, this method writes class descriptors according to the format defined in the Java Object Serialization Specification.

Note that this method will only be called if the ObjectOutputStream is not using the old serialization stream format (set by calling ObjectOutputStream's useProtocolVersion method). If this serialization stream is using the old format (PROTOCOL_VERSION_1), the class descriptor will be written internally in a manner that cannot be overridden or customized.

Parameters
desc:ObjectStreamClass

class descriptor to write to the stream

Annotations
@Override
Exceptions
IOException:
If an I/O error has occurred.