Home
last modified time | relevance | path

Searched refs:crc (Results 1 – 25 of 26) sorted by relevance

12

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/zip/
DCRC32Test.java29 CRC32 crc = new CRC32(); in test_Constructor() local
30 assertEquals("Constructor of CRC32 failed", 0, crc.getValue()); in test_Constructor()
38 CRC32 crc = new CRC32(); in test_getValue() local
40 0, crc.getValue()); in test_getValue()
42 crc.reset(); in test_getValue()
43 crc.update(Integer.MAX_VALUE); in test_getValue()
48 4278190080L, crc.getValue()); in test_getValue()
50 crc.reset(); in test_getValue()
52 crc.update(byteEmpty); in test_getValue()
57 1295764014L, crc.getValue()); in test_getValue()
[all …]
DGZIPOutputStreamTest.java47 return crc; in getChecksum()
DGZIPInputStreamTest.java53 return crc; in getChecksum()
/libcore/ojluni/src/main/java/java/util/zip/
DCRC32C.java121 private int crc = 0xFFFFFFFF; field in CRC32C
135 crc = (crc >>> 8) ^ byteTable[(crc ^ (b & 0xFF)) & 0xFF]; in update()
154 crc = updateBytes(crc, b, off, (off + len)); in update()
176 crc = updateDirectByteBuffer(crc, ((DirectBuffer) buffer).address(), in update()
182 crc = updateBytes(crc, buffer.array(), pos + buffer.arrayOffset(), in update()
200 crc = 0xFFFFFFFF; in reset()
208 return (~crc) & 0xFFFFFFFFL; in getValue()
215 private static int updateBytes(int crc, byte[] b, int off, int end) { in updateBytes() argument
225 crc = (crc >>> 8) ^ byteTable[(crc ^ b[off]) & 0xFF]; in updateBytes()
229 crc = Integer.reverseBytes(crc); in updateBytes()
[all …]
DCRC32.java46 private int crc; field in CRC32
61 crc = update(crc, b); in update()
80 crc = updateBytes(crc, b, off, len); in update()
91 crc = updateBytes(crc, b, 0, b.length); in update()
113 crc = updateByteBuffer(crc, ((DirectBuffer)buffer).address(), pos, rem); in update()
118 crc = updateBytes(crc, buffer.array(), pos + buffer.arrayOffset(), rem); in update()
135 crc = 0; in reset()
143 return (long)crc & 0xffffffffL; in getValue()
148 private static native int update(int crc, int b); in update() argument
150 private static int updateBytes(int crc, byte[] b, int off, int len) { in updateBytes() argument
[all …]
DZipInputStream.java52 private CRC32 crc = new CRC32(); field in ZipInputStream
135 crc.reset(); in getNextEntry()
227 crc.update(b, off, len); in read()
247 crc.update(b, off, len); in read()
249 if (remaining == 0 && entry.crc != crc.getValue()) { in read()
251 "invalid entry CRC (expected 0x" + Long.toHexString(entry.crc) + in read()
252 " but got 0x" + Long.toHexString(crc.getValue()) + ")"); in read()
353 e.crc = get32(tmpbuf, LOCCRC); in readLOC()
407 e.crc = sig; in readEnd()
413 e.crc = get32(tmpbuf, ZIP64_EXTCRC); in readEnd()
[all …]
DGZIPInputStream.java48 protected CRC32 crc = new CRC32(); field in GZIPInputStream
141 crc.update(buf, off, n); in read()
178 CheckedInputStream in = new CheckedInputStream(this_in, crc); in readHeader()
179 crc.reset(); in readHeader()
213 int v = (int)crc.getValue() & 0xffff; in readHeader()
219 crc.reset(); in readHeader()
239 if ((readUInt(in) != crc.getValue()) || in readTrailer()
DZipEntry.java55 long crc = -1; // crc-32 of entry data field in ZipEntry
105 public ZipEntry(String name, String comment, long crc, long compressedSize, in ZipEntry() argument
110 this.crc = crc; in ZipEntry()
158 crc = e.crc; in ZipEntry()
508 public void setCrc(long crc) { in setCrc() argument
509 if (crc < 0 || crc > 0xFFFFFFFFL) { in setCrc()
512 this.crc = crc; in setCrc()
524 return crc; in getCrc()
DZipOutputStream.java74 private CRC32 crc = new CRC32(); field in ZipOutputStream
222 if (e.size == -1 || e.csize == -1 || e.crc == -1 || !e.csizeSet) { in putNextEntry()
237 if (e.size == -1 || e.crc == -1) { in putNextEntry()
284 if (e.crc != crc.getValue()) { in closeEntry()
287 Long.toHexString(e.crc) + " but got 0x" + in closeEntry()
288 Long.toHexString(crc.getValue()) + ")"); in closeEntry()
293 e.crc = crc.getValue(); in closeEntry()
306 if (e.crc != crc.getValue()) { in closeEntry()
309 Long.toHexString(e.crc) + " but got 0x" + in closeEntry()
310 Long.toHexString(crc.getValue()) + ")"); in closeEntry()
[all …]
DGZIPOutputStream.java42 protected CRC32 crc = new CRC32(); field in GZIPOutputStream
105 crc.reset(); in GZIPOutputStream()
156 crc.update(buf, off, len); in write()
217 writeInt((int)crc.getValue(), buf, offset); // CRC-32 of uncompr. data in writeTrailer()
DZipFile.java713 e.crc = CENCRC(cen, pos); in getZipEntry()
/libcore/ojluni/src/main/native/
DCRC32.c35 Java_java_util_zip_CRC32_update(jint crc, jint b) in Java_java_util_zip_CRC32_update() argument
40 return crc32(crc, buf, 1); in Java_java_util_zip_CRC32_update()
44 Java_java_util_zip_CRC32_updateBytes0(JNIEnv *env, jclass cls, jint crc, in Java_java_util_zip_CRC32_updateBytes0() argument
49 crc = crc32(crc, buf + off, len); in Java_java_util_zip_CRC32_updateBytes0()
52 return crc; in Java_java_util_zip_CRC32_updateBytes0()
56 ZIP_CRC32(jint crc, const jbyte *buf, jint len) in ZIP_CRC32() argument
58 return crc32(crc, (Bytef*)buf, len); in ZIP_CRC32()
62 Java_java_util_zip_CRC32_updateByteBuffer0(JNIEnv *env, jclass cls, jint crc, in Java_java_util_zip_CRC32_updateByteBuffer0() argument
67 crc = crc32(crc, buf + off, len); in Java_java_util_zip_CRC32_updateByteBuffer0()
69 return crc; in Java_java_util_zip_CRC32_updateByteBuffer0()
Dzip_util.h166 jint crc; /* crc of uncompressed data */ member
DZipFile.c244 return (jlong)ze->crc & 0xffffffffUL; in ZipFile_getEntryCrc()
Dzip_util.c1140 ze->crc = CENCRC(cen); in newEntry()
/libcore/support/src/test/java/tests/resources/
Dhyts_checkInput.txt1 crc.reset();
2 crc.update(1);
3 //System.out.print("value of crc"+crc.getValue());
/libcore/luni/src/test/java/libcore/java/util/zip/
DOldAndroidChecksumTest.java56 CRC32 crc = new CRC32(); in cRC32Test() local
59 crc.update(values); in cRC32Test()
60 assertEquals(crc.getValue(), expected); in cRC32Test()
63 crc.reset(); in cRC32Test()
65 crc.update(values[i]); in cRC32Test()
67 assertEquals(crc.getValue(), expected); in cRC32Test()
DAbstractZipFileTest.java144 CRC32 crc = new CRC32(); in testStoredEntrySize() local
145 crc.update(buffer); in testStoredEntrySize()
146 outEntry.setCrc(crc.getValue()); in testStoredEntrySize()
261 CRC32 crc = new CRC32(); in testSTORED() local
297 ze.setCrc(crc.getValue()); in testSTORED()
307 ze.setCrc(crc.getValue()); in testSTORED()
327 ze.setCrc(crc.getValue()); in testSTORED()
347 ze.setCrc(crc.getValue()); in testSTORED()
358 ze.setCrc(crc.getValue()); in testSTORED()
/libcore/benchmarks/src/benchmarks/regression/
DChecksumBenchmark.java38 CRC32 crc = new CRC32(); in timeCrc_block() local
40 crc.update(bytes); in timeCrc_block()
44 CRC32 crc = new CRC32(); in timeCrc_byte() local
46 crc.update(1); in timeCrc_byte()
/libcore/ojluni/annotations/hiddenapi/java/util/zip/
DCRC32.java62 private static native int update(int crc, int b); in update() argument
64 private static native int updateBytes(int crc, byte[] b, int off, int len); in updateBytes() argument
68 private int crc; field in CRC32
DZipEntry.java38 long crc, in ZipEntry() argument
116 public void setCrc(long crc) { in setCrc() argument
180 long crc = -1; // 0xffffffff field in ZipEntry
DZipInputStream.java97 private java.util.zip.CRC32 crc; field in ZipInputStream
DZipOutputStream.java137 private java.util.zip.CRC32 crc; field in ZipOutputStream
/libcore/ojluni/annotations/mmodule/java/util/zip/
DZipEntry.annotated.java35 public ZipEntry(java.lang.String name, java.lang.String comment, long crc, long compressedSize, lon… in ZipEntry() argument
70 public void setCrc(long crc) { throw new RuntimeException("Stub!"); } in setCrc() argument
/libcore/ojluni/annotations/flagged_api/java/util/zip/
DZipEntry.annotated.java72 public void setCrc(long crc) { throw new RuntimeException("Stub!"); } in setCrc() argument

12