| Checksum.java |
1 /*
2 * %W% %E%
3 *
4 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
5 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6 */
7
8 package java.util.zip;
9
10 /**
11 * An interface representing a data checksum.
12 *
13 * @version %I%, %G%
14 * @author David Connelly
15 */
16 public
17 interface Checksum {
18 /**
19 * Updates the current checksum with the specified byte.
20 *
21 * @param b the byte to update the checksum with
22 */
23 public void update(int b);
24
25 /**
26 * Updates the current checksum with the specified array of bytes.
27 * @param b the byte array to update the checksum with
28 * @param off the start offset of the data
29 * @param len the number of bytes to use for the update
30 */
31 public void update(byte[] b, int off, int len);
32
33 /**
34 * Returns the current checksum value.
35 * @return the current checksum value
36 */
37 public long getValue();
38
39 /**
40 * Resets the checksum to its initial value.
41 */
42 public void reset();
43 }
44