Class ComparableBytes

  • All Implemented Interfaces:
    Comparable<org.apache.hadoop.io.BinaryComparable>

    public class ComparableBytes
    extends org.apache.hadoop.io.BinaryComparable
    An array of bytes wrapped so as to extend Hadoop's BinaryComparable class.
    • Field Detail

      • data

        public byte[] data
    • Constructor Detail

      • ComparableBytes

        public ComparableBytes​(byte[] b)
        Creates a new byte wrapper. The given byte array is used directly as a backing array, so later changes made to the array reflect into the new object.
        Parameters:
        b - bytes to wrap
    • Method Detail

      • getBytes

        public byte[] getBytes()
        Gets the wrapped bytes in this object.
        Specified by:
        getBytes in class org.apache.hadoop.io.BinaryComparable
        Returns:
        bytes
      • getLength

        public int getLength()
        Specified by:
        getLength in class org.apache.hadoop.io.BinaryComparable