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 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

      public void readFields(DataInput in) throws IOException
      Description copied from interface: Writable
      Deserialize the fields of this object from in.

      For efficiency, implementations should attempt to re-use storage in the existing object where possible.

      Specified by:
      readFields in interface Writable
      Parameters:
      in - DataInput to deseriablize this object from.
      Throws:
      IOException - any other problem for readFields.
    • write

      public void write(DataOutput out) throws IOException
      Description copied from interface: Writable
      Serialize the fields of this object to out.
      Specified by:
      write in interface Writable
      Parameters:
      out - DataOuput to serialize this object into.
      Throws:
      IOException - any other problem for write.
    • equals

      public boolean equals(Object o)
      Returns true iff o is a VIntWritable with the same value.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(VIntWritable o)
      Compares two VIntWritables.
      Specified by:
      compareTo in interface Comparable<VIntWritable>
    • toString

      public String toString()
      Overrides:
      toString in class Object