@InterfaceAudience.Public @InterfaceStability.Stable public abstract class VersionedWritable extends Object implements Writable
This is useful when a class may evolve, so that instances written by the
old version of the class may still be processed by the new version. To
handle this situation, readFields(DataInput)
implementations should catch VersionMismatchException.
| Constructor and Description |
|---|
VersionedWritable() |
| Modifier and Type | Method and Description |
|---|---|
abstract byte |
getVersion()
Return the version number of the current implementation.
|
void |
readFields(DataInput in)
Deserialize the fields of this object from
in. |
void |
write(DataOutput out)
Serialize the fields of this object to
out. |
public abstract byte getVersion()
public void write(DataOutput out) throws IOException
Writableout.write in interface Writableout - DataOuput to serialize this object into.IOExceptionpublic void readFields(DataInput in) throws IOException
Writablein.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface Writablein - DataInput to deseriablize this object from.IOExceptionCopyright © 2008–2022 Apache Software Foundation. All rights reserved.