public class FitsCheckSum extends Object
nom.tam.fits.utilities.FitsCheckSum. This class is a
little more flexible, specifically it allows the checksum to be accumulated
across several invocations of the updateChecksum(java.nio.ByteBuffer, org.lsst.ccs.utilities.image.FitsCheckSum.Checksum) method, and allows
for the DATASUM keyword to be updated after data has been changed. It also
provides a method for decoding an encoded checksum.| Modifier and Type | Class and Description |
|---|---|
static class |
FitsCheckSum.Checksum
Encapsulation of a FITS check sum.
|
| Modifier and Type | Method and Description |
|---|---|
static long |
checksum(byte[] data)
Calculate the Seaman-Pence 32-bit 1's complement checksum over the byte
stream.
|
static long |
checksumDecode(String encoded)
Decodes an encoded checksum, the opposite of
checksumEncode(long) |
static String |
checksumEnc(long c,
boolean compl)
Encode a 32bit integer according to the Seaman-Pence proposal.
|
static String |
checksumEncode(long checksum)
Encode the given checksum, including the rotating the result right by one byte.
|
static long |
computeChecksum(ByteBuffer data)
Compute a FITS check sum from a ByteBuffer
|
static void |
setChecksum(nom.tam.fits.BasicHDU<?> hdu)
Add or update the CHECKSUM keyword.
|
static long |
updateChecksum(ByteBuffer data,
FitsCheckSum.Checksum inOut)
Update a check sum from a ByteBuffer
|
static void |
updateCheckSum(nom.tam.fits.Header header,
long delta)
Apply an incremental update to the checksum, as a result of changing one of more records
|
public static long checksum(byte[] data)
Checksum.CHECKSUMdata - the byte sequencepublic static long computeChecksum(ByteBuffer data)
data - The ByteBuffer to use as a source of datapublic static long updateChecksum(ByteBuffer data, FitsCheckSum.Checksum inOut)
data - The ByteBuffer to use as a source of datainOut - The previously accumulated check sum, updated in place
with the additional data.public static String checksumEnc(long c, boolean compl)
c - the checksum previously calculatedcompl - complement the valuepublic static String checksumEncode(long checksum)
checksum - public static long checksumDecode(String encoded)
checksumEncode(long)encoded - The encoded checksum (16 character string)public static void updateCheckSum(nom.tam.fits.Header header,
long delta)
header - The header to updatedelta - The change in the checksumpublic static void setChecksum(nom.tam.fits.BasicHDU<?> hdu)
throws nom.tam.fits.FitsException
hdu - the HDU to be updated.nom.tam.fits.FitsException - if the operation failedCopyright © 2023 LSST. All rights reserved.