Package org.greenrobot.essentials.hash
Class PrimitiveDataChecksum
- java.lang.Object
-
- org.greenrobot.essentials.hash.PrimitiveDataChecksum
-
- All Implemented Interfaces:
java.util.zip.Checksum
public class PrimitiveDataChecksum extends java.lang.Object implements java.util.zip.ChecksumWrapper for Checksum that accepts all kind of primitive data to update the hash.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.zip.Checksumchecksum
-
Constructor Summary
Constructors Constructor Description PrimitiveDataChecksum(java.util.zip.Checksum checksum)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetValue()voidreset()voidupdate(byte[] numbers)Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).voidupdate(byte[] b, int off, int len)voidupdate(double[] numbers)Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).voidupdate(float[] numbers)Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).voidupdate(int b)voidupdate(int[] numbers)Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).voidupdate(long[] numbers)Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).voidupdate(short[] numbers)Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).voidupdateBoolean(boolean value)updates a byte with 0 for false and 1 for truevoidupdateDouble(double number)voidupdateFloat(float number)voidupdateInt(int number)voidupdateLong(long number)voidupdateShort(short number)voidupdateUtf8(java.lang.String string)Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).voidupdateUtf8(java.lang.String[] strings)Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
-
-
-
Method Detail
-
update
public void update(int b)
- Specified by:
updatein interfacejava.util.zip.Checksum
-
update
public void update(byte[] b, int off, int len)- Specified by:
updatein interfacejava.util.zip.Checksum
-
getValue
public long getValue()
- Specified by:
getValuein interfacejava.util.zip.Checksum
-
reset
public void reset()
- Specified by:
resetin interfacejava.util.zip.Checksum
-
updateUtf8
public void updateUtf8(java.lang.String string)
Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
-
updateUtf8
public void updateUtf8(java.lang.String[] strings)
Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
-
updateBoolean
public void updateBoolean(boolean value)
updates a byte with 0 for false and 1 for true
-
updateShort
public void updateShort(short number)
-
updateInt
public void updateInt(int number)
-
updateLong
public void updateLong(long number)
-
updateFloat
public void updateFloat(float number)
-
updateDouble
public void updateDouble(double number)
-
update
public void update(byte[] numbers)
Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).- Specified by:
updatein interfacejava.util.zip.Checksum
-
update
public void update(short[] numbers)
Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
-
update
public void update(int[] numbers)
Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
-
update
public void update(long[] numbers)
Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
-
update
public void update(float[] numbers)
Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
-
update
public void update(double[] numbers)
Note: leaves the checksum untouched if given value is null (provide a special value for stronger hashing).
-
-