summaryrefslogtreecommitdiff
path: root/java/util/zip/CRC32.java
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2001-10-05 11:34:48 +0000
committerMark Wielaard <mark@klomp.org>2001-10-05 11:34:48 +0000
commit67be6239c8be55c0f3ccb28864494cb3d97d4a5c (patch)
tree9b623fd9d2dbbf2d07565540d80696aa01fa8134 /java/util/zip/CRC32.java
parent72c3dfa6cbc0de5d70b64eacf986b2dc332adb24 (diff)
downloadclasspath-67be6239c8be55c0f3ccb28864494cb3d97d4a5c.tar.gz
* java/util/zip/Adler32.java: Merge with libgcj
* java/util/zip/CRC32.java: Merge with libgcj * java/util/zip/CheckedInputStream.java: New file from libgcj * java/util/zip/CheckedOutputStream.java: Ditto * java/util/zip/Checksum.java: Merge with libgcj * java/util/zip/DataFormatException.java: Ditto * java/util/zip/ZipException.java: Ditto * java/util/zip/Makefile.am: add new classes
Diffstat (limited to 'java/util/zip/CRC32.java')
-rw-r--r--java/util/zip/CRC32.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/java/util/zip/CRC32.java b/java/util/zip/CRC32.java
index e28ef502b..f35b7723a 100644
--- a/java/util/zip/CRC32.java
+++ b/java/util/zip/CRC32.java
@@ -1,5 +1,5 @@
-/* java.util.zip.CRC32
- Copyright (C) 2001 Free Software Foundation, Inc.
+/* CRC32.java - Computes CRC32 data checksum of a data stream
+ Copyright (C) 1999. 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,7 +55,7 @@ public class CRC32 implements Checksum
private static int[] crc_table = make_crc_table();
/** Make the table for a fast CRC. */
- private static int[] make_crc_table()
+ private static int[] make_crc_table ()
{
int[] crc_table = new int[256];
for (int n = 0; n < 256; n++)
@@ -76,7 +76,7 @@ public class CRC32 implements Checksum
/**
* Returns the CRC32 data checksum computed so far.
*/
- public long getValue()
+ public long getValue ()
{
return (long) crc & 0xffffffffL;
}
@@ -84,16 +84,15 @@ public class CRC32 implements Checksum
/**
* Resets the CRC32 data checksum as if no update was ever called.
*/
- public void reset() { crc = 0; }
+ public void reset () { crc = 0; }
/**
* Updates the checksum with the int bval.
*
* @param bval (the byte is taken as the lower 8 bits of bval)
- *
*/
- public void update(int bval)
+ public void update (int bval)
{
int c = ~crc;
c = crc_table[(c ^ bval) & 0xff] ^ (c >>> 8);
@@ -107,7 +106,7 @@ public class CRC32 implements Checksum
* @param off the offset in the buffer where the data starts
* @param len the length of the data
*/
- public void update(byte[] buf, int off, int len)
+ public void update (byte[] buf, int off, int len)
{
int c = ~crc;
while (--len >= 0)
@@ -118,5 +117,5 @@ public class CRC32 implements Checksum
/**
* Adds the complete byte array to the data checksum.
*/
- public void update(byte[] buf) { update(buf, 0, buf.length); }
+ public void update (byte[] buf) { update(buf, 0, buf.length); }
}