public class CheckedInputStream extends FilterInputStream
Checksum
in
Constructor and Description |
---|
CheckedInputStream(InputStream in, Checksum cksum)
创建使用指定的校验输入流。
|
Modifier and Type | Method and Description |
---|---|
Checksum |
getChecksum()
返回当前输入流的校验。
|
int |
read()
读取一个字节。
|
int |
read(byte[] buf, int off, int len)
读入一个字节数组。
|
long |
skip(long n)
跳过指定数目的输入字节。
|
available, close, mark, markSupported, read, reset
public CheckedInputStream(InputStream in, Checksum cksum)
in
-输入流
cksum
-校验
public int read() throws IOException
read
方法重写,继承类
FilterInputStream
IOException
如果发生I/O错误
FilterInputStream.in
public int read(byte[] buf, int off, int len) throws IOException
len
不为零,该方法阻塞直到输入可用;否则,没有字节读取和
0
返回。
read
方法重写,继承类
FilterInputStream
buf
-缓冲区中读取数据
off
-开始抵消目标数组
b
len
-的最大字节数读
null
buf
NullPointerException
。
IndexOutOfBoundsException
-如果
off
是负的,
len
是负的,或
len
大于
buf.length - off
IOException
如果发生I/O错误
FilterInputStream.in
public long skip(long n) throws IOException
skip
方法重写,继承类
FilterInputStream
n
-字节数跳过
IOException
如果发生I/O错误
public Checksum getChecksum()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.