예제 #1
0
파일: HashCode.java 프로젝트: masonmei/mx2
 @Override
 public long asLong() {
   Preconditions.checkState(
       this.bytes.length >= 8,
       "HashCode#asLong() requires >= 8 bytes (it only has %s bytes).",
       this.bytes.length);
   return this.padToLong();
 }
예제 #2
0
파일: HashCode.java 프로젝트: masonmei/mx2
 @Override
 public int asInt() {
   Preconditions.checkState(
       this.bytes.length >= 4,
       "HashCode#asInt() requires >= 4 bytes (it only has %s bytes).",
       this.bytes.length);
   return (this.bytes[0] & 0xFF)
       | (this.bytes[1] & 0xFF) << 8
       | (this.bytes[2] & 0xFF) << 16
       | (this.bytes[3] & 0xFF) << 24;
 }