Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.util.zip

Class CheckedOutputStream

java.lang.Object
|
+--java.io.OutputStream
   |
   +--java.io.FilterOutputStream
      |
      +--java.util.zip.CheckedOutputStream


public class CheckedOutputStream

extends FilterOutputStream

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

Author:See Also:

Constructor Summary

CheckedOutputStream(java.io.OutputStream out, java.util.zip.Checksum cksum)

Creates a new CheckInputStream on top of the supplied OutputStream using the supplied Checksum.

Method Summary

java.util.zip.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 Details

CheckedOutputStream

public CheckedOutputStream(java.io.OutputStream out, java.util.zip.Checksum cksum)

Creates a new CheckInputStream on top of the supplied OutputStream using the supplied Checksum.

Parameters:


Method Details

getChecksum

public Checksum getChecksum()

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


write

public void write(byte[] buf, int off, int len)

Writes the byte array to the OutputStream and updates the Checksum.

Parameters:


write

public void write(int bval)

Writes one byte to the OutputStream and updates the Checksum.

Parameters: