|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
edu.rice.cs.plt.io.DirectOutputStream
edu.rice.cs.plt.io.ChecksumOutputStream
public class ChecksumOutputStream
A stream that accumulates its bytes in a Checksum object.
| Field Summary |
|---|
| Fields inherited from class edu.rice.cs.plt.io.DirectOutputStream |
|---|
DEFAULT_BUFFER_SIZE |
| Constructor Summary | |
|---|---|
ChecksumOutputStream(Checksum checksum)
Instantiate with the given Checksum. |
|
| Method Summary | |
|---|---|
void |
close()
|
void |
flush()
|
long |
getValue()
Return checksum.getValue(). |
static ChecksumOutputStream |
makeAdler32()
Create a stream for computing Adler-32 checksums. |
static ChecksumOutputStream |
makeCRC32()
Create a stream for computing CRC-32 checksums. |
void |
write(byte[] bbuf)
Delegate to the more general DirectOutputStream.write(byte[], int, int) method |
void |
write(byte[] bbuf,
int offset,
int len)
Subclasses are, at a minimum, required to implement this method. |
void |
write(int b)
Delegate to the more general DirectOutputStream.write(byte[], int, int) method |
| Methods inherited from class edu.rice.cs.plt.io.DirectOutputStream |
|---|
write, write, write, writeAll, writeAll, writeAll |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChecksumOutputStream(Checksum checksum)
checksum will not be reset, and
may contain a partially-computed value.
| Method Detail |
|---|
public long getValue()
checksum.getValue(). For 32-bit checksums, this can be cast to an int
without losing any information.
public void close()
close in interface Closeableclose in class OutputStreampublic void flush()
flush in interface Flushableflush in class OutputStreampublic void write(byte[] bbuf)
DirectOutputStreamDirectOutputStream.write(byte[], int, int) method
write in class DirectOutputStream
public void write(byte[] bbuf,
int offset,
int len)
DirectOutputStream
write in class DirectOutputStreampublic void write(int b)
DirectOutputStreamDirectOutputStream.write(byte[], int, int) method
write in class DirectOutputStreampublic static ChecksumOutputStream makeCRC32()
CRC32public static ChecksumOutputStream makeAdler32()
Adler32
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||