|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream net.sf.zipme.CheckedOutputStream
OutputStream that computes a checksum of data being written using a supplied Checksum object.
Checksum
Field Summary | |
protected java.io.OutputStream |
out
This is the subordinate OutputStream that this class
redirects its method calls to. |
Constructor Summary | |
CheckedOutputStream(java.io.OutputStream out,
Checksum cksum)
Creates a new CheckInputStream on top of the supplied OutputStream using the supplied Checksum. |
Method Summary | |
void |
close()
This method closes the underlying OutputStream . |
void |
flush()
This method attempt to flush all buffered output to be written to the underlying output sink. |
Checksum |
getChecksum()
Returns the Checksum object used. |
void |
write(byte[] buf)
This method writes all the bytes in the specified array to the underlying OutputStream . |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.io.OutputStream out
OutputStream
that this class
redirects its method calls to.
Constructor Detail |
public CheckedOutputStream(java.io.OutputStream out, Checksum cksum)
Method Detail |
public Checksum getChecksum()
getChecksum.getValue()
.
public void write(int bval) throws java.io.IOException
java.io.IOException
public void write(byte[] buf) throws java.io.IOException
OutputStream
. It does this by calling the three parameter
version of this method - write(byte[], int, int)
in this
class instead of writing to the underlying OutputStream
directly. This allows most subclasses to avoid overriding this method.
buf
- The byte array to write bytes from
java.io.IOException
- If an error occurspublic void write(byte[] buf, int off, int len) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
OutputStream
. Any
further attempts to write to this stream may throw an exception.
java.io.IOException
- If an error occurspublic void flush() throws java.io.IOException
java.io.IOException
- If an error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |