public class CheckedOutputStream extends FilterOutputStream
Checksum
out
Constructor and Description |
---|
CheckedOutputStream(OutputStream out,
Checksum cksum)
Creates a new CheckInputStream on top of the supplied OutputStream
using the supplied Checksum.
|
Modifier and Type | Method and Description |
---|---|
Checksum |
getChecksum()
Returns the Checksum object used.
|
void |
write(byte[] buf,
int off,
int len)
Writes the byte array to the OutputStream and updates the Checksum.
|
void |
write(int bval)
Writes one byte to the OutputStream and updates the Checksum.
|
close, flush, write
public CheckedOutputStream(OutputStream out, Checksum cksum)
public Checksum getChecksum()
getChecksum.getValue()
.public void write(int bval) throws IOException
write
in class FilterOutputStream
bval
- The byte to write, passed as an int.IOException
- If an error occurspublic void write(byte[] buf, int off, int len) throws IOException
write
in class FilterOutputStream
buf
- The byte array to write bytes fromoff
- The index into the array to start writing bytes fromlen
- The number of bytes to writeIOException
- If an error occurs