voldemort.utils
Class ByteArray

java.lang.Object
  extended by voldemort.utils.ByteArray
All Implemented Interfaces:
java.io.Serializable

public final class ByteArray
extends java.lang.Object
implements java.io.Serializable

A byte array container that provides an equals and hashCode pair based on the contents of the byte array. This is useful as a key for Maps.

See Also:
Serialized Form

Field Summary
static ByteArray EMPTY
           
 
Constructor Summary
ByteArray(byte... underlying)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 byte[] get()
           
 int hashCode()
           
 int length()
           
static java.lang.Iterable<java.lang.String> toHexStrings(java.lang.Iterable<ByteArray> arrays)
          Translate the each ByteArray in an iterable into a hexidecimal string
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final ByteArray EMPTY
Constructor Detail

ByteArray

public ByteArray(byte... underlying)
Method Detail

get

public byte[] get()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toHexStrings

public static java.lang.Iterable<java.lang.String> toHexStrings(java.lang.Iterable<ByteArray> arrays)
Translate the each ByteArray in an iterable into a hexidecimal string

Parameters:
arrays - The array of bytes to translate
Returns:
An iterable of converted strings

length

public int length()


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu