Class Overview
The CheckedOutputStream class is used to maintain a running Checksum of all
data written to a stream.
Summary
| Public Methods |
|
Checksum
|
getChecksum()
Returns the Checksum calculated on the stream thus far.
|
|
void
|
write(int val)
Writes byte value val to the underlying stream.
|
|
void
|
write(byte[] buf, int off, int nbytes)
Writes nbytes of data from buf starting at offset off to the underlying
stream.
|
|
[Expand]
Inherited Methods |
From class java.io.FilterOutputStream
|
void
|
close()
Close this FilterOutputStream.
|
|
void
|
flush()
Flush this FilterOutputStream to ensure all pending data is sent out to
the target OutputStream.
|
|
void
|
write(byte[] buffer)
Writes the entire contents of the byte array buffer to
this FilterOutputStream.
|
|
void
|
write(int oneByte)
Writes the specified byte oneByte to this
FilterOutputStream.
|
|
void
|
write(byte[] buffer, int offset, int count)
Writes count bytes from the byte array
buffer starting at offset to this
FilterOutputStream.
|
|
From class java.io.OutputStream
|
void
|
close()
Close this OutputStream.
|
|
void
|
flush()
Flush this OutputStream.
|
|
void
|
write(byte[] buffer)
Writes the entire contents of the byte array buffer to
this OutputStream.
|
|
abstract
void
|
write(int oneByte)
Writes the specified byte oneByte to this OutputStream.
|
|
void
|
write(byte[] buffer, int offset, int count)
Writes count bytes from the byte array
buffer starting at offset to this
OutputStream.
|
|
From class java.lang.Object
|
Object
|
clone()
Returns a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver.
|
|
boolean
|
equals(Object o)
Compares the argument to the receiver, and returns true if they represent
the same object using a class specific comparison.
|
|
void
|
finalize()
Called by the virtual machine when there are no longer any (non-weak)
references to the receiver.
|
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of java.lang.Class which represents the class
of the receiver.
|
|
int
|
hashCode()
Returns an integer hash code for the receiver.
|
|
final
void
|
notify()
Causes one thread which is wait ing on the receiver to be
made ready to run.
|
|
final
void
|
notifyAll()
Causes all threads which are wait ing on the receiver to
be made ready to run.
|
|
String
|
toString()
Returns a string containing a concise, human-readable description of the
receiver.
|
|
final
void
|
wait(long time, int frac)
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll) or the expiration of
the timeout.
|
|
final
void
|
wait(long time)
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll) or the expiration of
the timeout.
|
|
final
void
|
wait()
Causes the thread which sent this message to be made not ready to run
pending some change in the receiver (as indicated by notify
or notifyAll).
|
|
From interface java.io.Closeable
|
abstract
void
|
close()
Close the object and release any system resources it holds.
|
|
From interface java.io.Flushable
|
abstract
void
|
flush()
Flushes the object by writing out any buffered data to the underlying
output.
|
|
Public Constructors
Constructs a new CheckedOutputStream on OutputStream os. The Checksum
will be calculated using the algorithm implemented by csum.
Parameters
| os
| OutputStream to calculate checksum from |
| cs
| Type of Checksum to calculate
|
Public Methods
public
Checksum
getChecksum
()
Returns the Checksum calculated on the stream thus far.
public
void
write
(int val)
Writes byte value val to the underlying stream. The Checksum is updated
with val.
Parameters
| val
| Value of the byte to write out |
public
void
write
(byte[] buf, int off, int nbytes)
Writes nbytes of data from buf starting at offset off to the underlying
stream. The Checksum is updated with the bytes written.
Parameters
| buf
| data to write out |
| off
| the start offset of the data |
| nbytes
| number of bytes to write out |