Package org.apache.hadoop.io
Class VIntWritable
java.lang.Object
org.apache.hadoop.io.VIntWritable
- All Implemented Interfaces:
Comparable<VIntWritable>,Writable,WritableComparable<VIntWritable>
@Public
@Stable
public class VIntWritable
extends Object
implements WritableComparable<VIntWritable>
A WritableComparable for integer values stored in variable-length format.
Such values take between one and five bytes. Smaller values take fewer bytes.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares two VIntWritables.booleanReturns true iffois a VIntWritable with the same value.intget()inthashCode()voidreadFields(DataInput in) Deserialize the fields of this object fromin.voidset(int value) Set the value of this VIntWritable.toString()voidwrite(DataOutput out) Serialize the fields of this object toout.
-
Constructor Details
-
VIntWritable
public VIntWritable() -
VIntWritable
public VIntWritable(int value)
-
-
Method Details
-
set
public void set(int value) Set the value of this VIntWritable.- Parameters:
value- input value.
-
get
public int get()- Returns:
- Return the value of this VIntWritable.
-
readFields
Description copied from interface:WritableDeserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFieldsin interfaceWritable- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- any other problem for readFields.
-
write
Description copied from interface:WritableSerialize the fields of this object toout.- Specified by:
writein interfaceWritable- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
equals
Returns true iffois a VIntWritable with the same value. -
hashCode
public int hashCode() -
compareTo
Compares two VIntWritables.- Specified by:
compareToin interfaceComparable<VIntWritable>
-
toString
-