javax.rmi.CORBA

Interface ValueHandlerMultiFormat

public interface ValueHandlerMultiFormat extends ValueHandler

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

Since: 1.5

Method Summary
bytegetMaximumStreamFormatVersion()
Get the maximal supported version for the value types, supported by this value handler.
voidwriteValue(OutputStream output, Serializable value, byte version)
Write the value type to the output stream using the given format version.

Method Detail

getMaximumStreamFormatVersion

public 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

public void writeValue(OutputStream output, Serializable value, byte version)
Write the value type to the output stream using the given format version. The older method {@link ValueHandler#writeValue} always uses the version 1.

Parameters: output the stream, where the value should be written, must implement {@link 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.