javax.rmi.CORBA
Interface ValueHandlerMultiFormat

All Superinterfaces:
ValueHandler

public interface ValueHandlerMultiFormat
extends ValueHandler

This interface extends the previous ValueHandler, supporting various stream format versions. The ValueHandler can be casted into this interface to access additional features.

Since:
1.5

Method Summary
 byte getMaximumStreamFormatVersion()
          Get the maximal supported version for the value types, supported by this value handler.
 void writeValue(OutputStream output, Serializable value, byte version)
          Write the value type to the output stream using the given format version.
 
Methods inherited from interface javax.rmi.CORBA.ValueHandler
getRMIRepositoryID, getRunTimeCodeBase, isCustomMarshaled, readValue, writeReplace, writeValue
 

Method Detail

getMaximumStreamFormatVersion

byte getMaximumStreamFormatVersion()
Get the maximal supported version for the value types, supported by this value handler. The versions are integer numbers, the currently valid values being 1 and 2. These two versions differ in how the additional data, stored by the writeObject method, are encoded. As the version number is part of the value type record, there is no need to the format control during the reading.

Returns:
the maximal supported version.

writeValue

void writeValue(OutputStream output,
                Serializable value,
                byte version)
Write the value type to the output stream using the given format version. The older method ValueHandler.writeValue(org.omg.CORBA.portable.OutputStream, java.io.Serializable) always uses the version 1.

Parameters:
output - the stream, where the value should be written, must implement ValueOutputStream.
value - the value that should be written.
version - the version of the format that must be used to write the value.
Throws:
BAD_PARAM - if the version number is less than 1 or greater than the maximal supported version.