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, resetpublic 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 - 读取的最大字节数
NullPointerException - 如果
buf是
null 。
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.