jonelo.jacksum.algorithm

Class CombinedChecksum


public class CombinedChecksum
extends AbstractChecksum

Constructor Summary

CombinedChecksum()
Creates a new instance of CombinedChecksum
CombinedChecksum(String[] algos, boolean alternate)

Method Summary

void
addAlgorithm(String algorithm, boolean alternate)
void
firstFormat(StringBuffer formatBuf)
with this method the format() method can be customized, it will be launched at the beginning of format()
byte[]
getByteArray()
Returns the result of the computation as byte array.
void
reset()
void
setAlgorithms(String[] algos, boolean alternate)
void
setEncoding(String encoding)
Sets the encoding of the checksum.
void
update(byte b)
Updates all checksums with the specified byte.
void
update(byte[] bytes)
Updates all checksums with the specified array of bytes.
void
update(byte[] bytes, int offset, int length)
Updates all checksums with the specified array of bytes.
void
update(int b)
Updates all checksums with the specified byte.

Constructor Details

CombinedChecksum

public CombinedChecksum()
Creates a new instance of CombinedChecksum

CombinedChecksum

public CombinedChecksum(String[] algos,
                        boolean alternate)
            throws NoSuchAlgorithmException

Method Details

addAlgorithm

public void addAlgorithm(String algorithm,
                         boolean alternate)
            throws NoSuchAlgorithmException

firstFormat

public void firstFormat(StringBuffer formatBuf)
with this method the format() method can be customized, it will be launched at the beginning of format()

getByteArray

public byte[] getByteArray()
Returns the result of the computation as byte array.

reset

public void reset()

setAlgorithms

public void setAlgorithms(String[] algos,
                          boolean alternate)
            throws NoSuchAlgorithmException

setEncoding

public void setEncoding(String encoding)
            throws EncodingException
Sets the encoding of the checksum.
Parameters:
encoding - the encoding of the checksum.

update

public void update(byte b)
Updates all checksums with the specified byte.

update

public void update(byte[] bytes)
Updates all checksums with the specified array of bytes.

update

public void update(byte[] bytes,
                   int offset,
                   int length)
Updates all checksums with the specified array of bytes.

update

public void update(int b)
Updates all checksums with the specified byte.