Package org.apache.hadoop.io
Class ByteWritable
java.lang.Object
org.apache.hadoop.io.ByteWritable
- All Implemented Interfaces:
Comparable<ByteWritable>,Writable,WritableComparable<ByteWritable>
@Public
@Stable
public class ByteWritable
extends Object
implements WritableComparable<ByteWritable>
A WritableComparable for a single byte.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classorg.apache.hadoop.io.ByteWritable.ComparatorA Comparator optimized for ByteWritable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares two ByteWritables.booleanReturns true iffois a ByteWritable with the same value.byteget()Return the value of this ByteWritable.inthashCode()voidreadFields(DataInput in) Deserialize the fields of this object fromin.voidset(byte value) Set the value of this ByteWritable.toString()voidwrite(DataOutput out) Serialize the fields of this object toout.
-
Constructor Details
-
ByteWritable
public ByteWritable() -
ByteWritable
public ByteWritable(byte value)
-
-
Method Details
-
set
public void set(byte value) Set the value of this ByteWritable.- Parameters:
value- value.
-
get
public byte get()Return the value of this ByteWritable.- Returns:
- value bytes.
-
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 ByteWritable with the same value. -
hashCode
public int hashCode() -
compareTo
Compares two ByteWritables.- Specified by:
compareToin interfaceComparable<ByteWritable>
-
toString
-