CheckedOutputStreampublic class CheckedOutputStream extends FilterOutputStream An output stream that also maintains a checksum of the data being
written. The checksum can then be used to verify the integrity of
the output data. |
Fields Summary |
---|
private Checksum | cksum |
Constructors Summary |
---|
public CheckedOutputStream(OutputStream out, Checksum cksum)Creates an output stream with the specified Checksum.
super(out);
this.cksum = cksum;
|
Methods Summary |
---|
public java.util.zip.Checksum | getChecksum()Returns the Checksum for this output stream.
return cksum;
| public void | write(int b)Writes a byte. Will block until the byte is actually written.
out.write(b);
cksum.update(b);
| public void | write(byte[] b, int off, int len)Writes an array of bytes. Will block until the bytes are
actually written.
out.write(b, off, len);
cksum.update(b, off, len);
|
|