public class CheckedOutputStream
extends FilterOutputStream
| java.lang.Object | |||
| java.io.OutputStream | |||
| java.io.FilterOutputStream | |||
| java.util.zip.CheckedOutputStream | |||
一个输出流,也保持正在写入的数据的校验和。 校验和可以用来验证输出数据的完整性。
也可以看看:
Inherited fields |
|---|
java.io.FilterOutputStream
|
Public constructors |
|
|---|---|
CheckedOutputStream(OutputStream out, Checksum cksum) 用指定的校验和创建一个输出流。 |
|
公共方法(Public methods) |
|
|---|---|
Checksum |
getChecksum() 返回此输出流的校验和。 |
void |
write(byte[] b, int off, int len) 写入一个字节数组。 |
void |
write(int b) 写一个字节。 |
继承方法(Inherited methods) |
|
|---|---|
java.io.FilterOutputStream
|
|
java.io.OutputStream
|
|
java.lang.Object
|
|
java.io.Closeable
|
|
java.io.Flushable
|
|
java.lang.AutoCloseable
|
|
CheckedOutputStream (OutputStream out, Checksum cksum)
用指定的校验和创建一个输出流。
| 参数(Parameters) | |
|---|---|
out |
OutputStream: the output stream |
cksum |
Checksum: the checksum |
Checksum getChecksum ()
返回此输出流的校验和。
| 返回(Returns) | |
|---|---|
Checksum |
the Checksum |
void write (byte[] b,
int off,
int len)
写入一个字节数组。 将阻塞,直到实际写入字节。
| 参数(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 |
| 抛出异常(Throws) | |
|---|---|
IOException |
if an I/O error has occurred |
void write (int b)
写一个字节。 将阻塞,直到字节被实际写入。
| 参数(Parameters) | |
|---|---|
b |
int: the byte to be written |
| 抛出异常(Throws) | |
|---|---|
IOException |
if an I/O error has occurred |