public class CRC32 extends Object implements Checksum
将null参数传递给null中的方法将导致抛出NullPointerException 。
Checksum
| Constructor and Description |
|---|
CRC32()
创建一个新的CRC32对象。
|
| Modifier and Type | Method and Description |
|---|---|
long |
getValue()
返回CRC-32值。
|
void |
reset()
将CRC-32复位为初始值。
|
void |
update(byte[] b)
用指定的字节数组更新CRC-32校验和。
|
void |
update(byte[] b, int off, int len)
用指定的字节数组更新CRC-32校验和。
|
void |
update(ByteBuffer buffer)
使用指定缓冲区的字节更新校验和。
|
void |
update(int b)
用指定的字节更新CRC-32校验和(参数b的低8位)。
|
public void update(int b)
public void update(byte[] b,
int off,
int len)
update在界面
Checksum
b - 用于更新校验和的字节数组
off - 数据的起始偏移量
len - 用于更新的字节数
ArrayIndexOutOfBoundsException - 如果
off为负数,或
len为负数,或
off+len大于数组长度
b
public void update(byte[] b)
b - 用于更新校验和的字节数组
public void update(ByteBuffer buffer)
buffer - ByteBuffer更新校验和
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.