java.lang.Object | |||
↳ | java.io.OutputStream | ||
↳ | java.io.FilterOutputStream | ||
↳ | java.util.zip.CheckedOutputStream |
The
CheckedOutputStream
class is used to maintain a running checksum
of all data written to a stream. The purpose of this checksum is to establish
data integrity, by publishing the checksum to other parties wanting to read
the non corrupted data.
[Expand]
Inherited Fields
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.FilterOutputStream
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Constructs a new
CheckedOutputStream
on
OutputStream
os
.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Returns the checksum calculated on the stream read so far.
|
||||||||||
|
Writes n bytes of data from
buf
starting at offset
off
to
the underlying stream.
|
||||||||||
|
Writes the specified byte to the underlying stream.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.FilterOutputStream
|
|||||||||||
From class
java.io.OutputStream
|
|||||||||||
From class
java.lang.Object
|
|||||||||||
From interface
java.io.Closeable
|
|||||||||||
From interface
java.io.Flushable
|
|||||||||||
From interface
java.lang.AutoCloseable
|
Constructs a new
CheckedOutputStream
on
OutputStream
os
. The checksum is calculated using the algorithm implemented
by
csum
.
os | the output stream to calculate checksum for. |
---|---|
cs | an entity implementing the checksum algorithm. |
Returns the checksum calculated on the stream read so far.
Writes n bytes of data from
buf
starting at offset
off
to
the underlying stream. The checksum is updated with the bytes written.
buf | data written to the output stream. |
---|---|
off |
the offset to start reading the data from
buf
written
to the output stream.
|
nbytes | number of bytes to write to the output stream. |
IOException | if an IO error has occurred. |
---|
Writes the specified byte to the underlying stream. The checksum is
updated with
val
.
val | the data value to written to the output stream. |
---|
IOException | if an IO error has occurred. |
---|