java.util.zip

Class CheckedOutputStream

public class CheckedOutputStream extends FilterOutputStream

OutputStream that computes a checksum of data being written using a supplied Checksum object.

See Also:

UNKNOWN: May 17, 1999

Constructor Summary
CheckedOutputStream(OutputStream out, Checksum cksum)
Creates a new CheckInputStream on top of the supplied OutputStream using the supplied Checksum.
Method Summary
ChecksumgetChecksum()
Returns the Checksum object used.
voidwrite(int bval)
Writes one byte to the OutputStream and updates the Checksum.
voidwrite(byte[] buf, int off, int len)
Writes the byte array to the OutputStream and updates the Checksum.

Constructor Detail

CheckedOutputStream

public CheckedOutputStream(OutputStream out, Checksum cksum)
Creates a new CheckInputStream on top of the supplied OutputStream using the supplied Checksum.

Method Detail

getChecksum

public Checksum getChecksum()
Returns the Checksum object used. To get the data checksum computed so far call getChecksum.getValue().

write

public void write(int bval)
Writes one byte to the OutputStream and updates the Checksum.

write

public void write(byte[] buf, int off, int len)
Writes the byte array to the OutputStream and updates the Checksum.