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
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.
- For version 1 (GNU Classpath default), that data (if present) are
written "as is".
- For version 2, this data fragment is enclosed within a CDR custom
valuetype with no codebase and repository Id "RMI:org.omg.custom."
where is the fully-qualified name of the class whose writeObject
method is being invoked. If the object does not write any data via
writeObject method, the null valuetype (0x0) must be written.
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.
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.