APIdia Launch Partner
Top Description Fields Constructors Methods
java.util.zip

public Class CheckedOutputStream

extends FilterOutputStream
Class Inheritance
Imports
java.io.FilterOutputStream, .OutputStream, .IOException

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.
Author
David Connelly
Since
1.1
See Also
Checksum

Field Summary

Modifier and TypeField and Description
private Checksum
Inherited from java.io.FilterOutputStream:
out

Constructor Summary

AccessConstructor and Description
public
CheckedOutputStream(OutputStream
the output stream
out
,
Checksum
the checksum
cksum
)

Creates an output stream with the specified Checksum.

Method Summary

Modifier and TypeMethod and Description
public Checksum

Returns:

the Checksum
getChecksum
()

Returns the Checksum for this output stream.

public void
write(int
the byte to be written
b
)

Overrides java.io.FilterOutputStream.write.

Writes a byte.

public void
write(byte[]
the data to be written
b
,
int
the start offset of the data
off
,
int
the number of bytes to be written
len
)

Overrides java.io.FilterOutputStream.write.

Writes an array of bytes.

Inherited from java.io.FilterOutputStream:
closeflushwrite

Field Detail

cksumback to summary
private Checksum cksum

Constructor Detail

CheckedOutputStreamback to summary
public CheckedOutputStream(OutputStream out, Checksum cksum)

Creates an output stream with the specified Checksum.

Parameters
out:OutputStream

the output stream

cksum:Checksum

the checksum

Method Detail

getChecksumback to summary
public Checksum getChecksum()

Returns the Checksum for this output stream.

Returns:Checksum

the Checksum

writeback to summary
public void write(int b) throws IOException

Overrides java.io.FilterOutputStream.write.

Writes a byte. Will block until the byte is actually written.

Parameters
b:int

the byte to be written

Exceptions
IOException:
if an I/O error has occurred
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Overrides java.io.FilterOutputStream.write.

Writes an array of bytes. Will block until the bytes are actually written.

Parameters
b:byte[]

the data to be written

off:int

the start offset of the data

len:int

the number of bytes to be written

Exceptions
IOException:
if an I/O error has occurred