| Modifier and Type | Field and Description |
|---|---|
(package private) byte[] |
bytes |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
BytesHashCode(byte[] bytes) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
asBytes()
Returns the value of this hash code as a byte array.
|
int |
asInt()
Returns the first four bytes of this hashcode's bytes, converted to an
int value in little-endian order. |
long |
asLong()
Returns the first eight bytes of this hashcode's bytes, converted to a
long value in little-endian order. |
int |
bits()
Returns the number of bits in this hash code; a positive multiple of 8.
|
(package private) boolean |
equalsSameBits(HashCode that)
Returns whether this
HashCode and that HashCode have the same value, given that
they have the same number of bits. |
(package private) byte[] |
getBytesInternal()
Returns a mutable view of the underlying bytes for the given
HashCode if it is a
byte-based hashcode. |
long |
padToLong()
If this hashcode has enough bits, returns
asLong(), otherwise returns a long
value with asBytes() as the least-significant bytes and 0x00 as the remaining
most-significant bytes. |
(package private) void |
writeBytesToImpl(byte[] dest,
int offset,
int maxLength) |
equals, fromBytes, fromBytesNoCopy, fromInt, fromLong, fromString, hashCode, toString, writeBytesTofinal byte[] bytes
private static final long serialVersionUID
public int bits()
HashCodepublic byte[] asBytes()
HashCodeHashCode object or any other arrays
returned by this method.public int asInt()
HashCodeint value in little-endian order.public long asLong()
HashCodelong value in little-endian order.public long padToLong()
HashCodeasLong(), otherwise returns a long
value with asBytes() as the least-significant bytes and 0x00 as the remaining
most-significant bytes.void writeBytesToImpl(byte[] dest,
int offset,
int maxLength)
writeBytesToImpl in class HashCodebyte[] getBytesInternal()
HashCodeHashCode if it is a
byte-based hashcode. Otherwise it returns HashCode.asBytes(). Do not mutate this
array or else you will break the immutability contract of HashCode.getBytesInternal in class HashCodeboolean equalsSameBits(HashCode that)
HashCodeHashCode and that HashCode have the same value, given that
they have the same number of bits.equalsSameBits in class HashCode