1. /*
  2. * @(#)Checksum.java 1.15 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.util.zip;
  8. /**
  9. * An interface representing a data checksum.
  10. *
  11. * @version 1.15, 01/23/03
  12. * @author David Connelly
  13. */
  14. public
  15. interface Checksum {
  16. /**
  17. * Updates the current checksum with the specified byte.
  18. *
  19. * @param b the byte to update the checksum with
  20. */
  21. public void update(int b);
  22. /**
  23. * Updates the current checksum with the specified array of bytes.
  24. * @param b the byte array to update the checksum with
  25. * @param off the start offset of the data
  26. * @param len the number of bytes to use for the update
  27. */
  28. public void update(byte[] b, int off, int len);
  29. /**
  30. * Returns the current checksum value.
  31. * @return the current checksum value
  32. */
  33. public long getValue();
  34. /**
  35. * Resets the checksum to its initial value.
  36. */
  37. public void reset();
  38. }