public class ChecksumPair extends Object implements Cloneable, Serializable
| Constructor and Description |
|---|
ChecksumPair(int weak)
Create a new checksum pair with only weak checksum
|
ChecksumPair(int weak,
byte[] strong)
Create a new checksum pair with no associated offset.
|
ChecksumPair(int weak,
byte[] strong,
int seq)
Create a new checksum pair with no associated offset.
|
ChecksumPair(int weak,
byte[] strong,
long offset)
Create a new checksum pair with no length or sequence fields.
|
ChecksumPair(int weak,
byte[] strong,
long offset,
int length,
int seq)
Create a new checksum pair.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
We define equality for this object as equality between two weak
sums and equality between two strong sums.
|
int |
getLength()
Return the length of the data for which this checksum pair was
generated.
|
long |
getOffset()
Return the offset from where this checksum pair was generated.
|
int |
getSequence()
Return the sequence number of this checksum pair, if any.
|
byte[] |
getStrong()
Get the strong checksum.
|
String |
getStrongHex()
Get the strong checksum in hexadecimal format.
|
int |
getWeak()
Get the weak checksum.
|
String |
getWeakHex()
Get the weak checksum in hexadecimal format.
|
int |
hashCode()
Hashcode is produced from summing 4bytes of weakSum into 2bytes
|
String |
toString()
Returns a String representation of this pair.
|
public ChecksumPair(int weak,
byte[] strong,
long offset,
int length,
int seq)
weak - The weak, rolling checksum.strong - The strong checksum.offset - The offset at which this checksum was computed.length - The length of the data over which this sum was
computed.seq - The sequence number of this checksum pair.public ChecksumPair(int weak,
byte[] strong,
long offset)
weak - The weak checksum.strong - The strong checksum.offset - The offset at which this checksum was computed.public ChecksumPair(int weak,
byte[] strong)
weak - The weak checksum.strong - The strong checksum.public ChecksumPair(int weak)
weak - The weak checksum.public ChecksumPair(int weak,
byte[] strong,
int seq)
weak - The weak checksum.strong - The strong checksum.seq - The sequence numberpublic int getWeak()
public String getWeakHex()
public String getStrongHex()
public byte[] getStrong()
public long getOffset()
public int getLength()
public int getSequence()
public int hashCode()
public boolean equals(Object obj)
Copyright © 2021 McEvoy Software Ltd. All rights reserved.