Home
last modified time | relevance | path

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

/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/
DCRC32.java42 private int crc; field in CRC32
58 crc = update(crc, b); in update()
76 crc = updateBytes(crc, b, off, len); in update()
85 crc = updateBytes(crc, b, 0, b.length); in update()
109 crc = updateByteBuffer(crc, ((DirectBuffer)buffer).address(), pos, rem); in update()
111 crc = updateBytes(crc, buffer.array(), pos + buffer.arrayOffset(), rem); in update()
115 crc = updateBytes(crc, b, 0, b.length); in update()
124 crc = 0; in reset()
131 return (long)crc & 0xffffffffL; in getValue()
134 private native static int update(int crc, int b); in update() argument
[all …]
DZipInputStream.java49 private CRC32 crc = new CRC32(); field in ZipInputStream
122 crc.reset(); in getNextEntry()
208 crc.update(b, off, len); in read()
227 crc.update(b, off, len); in read()
229 if (remaining == 0 && entry.crc != crc.getValue()) { in read()
231 "invalid entry CRC (expected 0x" + Long.toHexString(entry.crc) + in read()
232 " but got 0x" + Long.toHexString(crc.getValue()) + ")"); in read()
325 e.crc = get32(tmpbuf, LOCCRC); in readLOC()
366 e.crc = sig; in readEnd()
372 e.crc = get32(tmpbuf, ZIP64_EXTCRC); in readEnd()
[all …]
DZipEntry.java53 long crc = -1; // crc-32 of entry data field in ZipEntry
79 public ZipEntry(String name, String comment, long crc, long compressedSize, in ZipEntry() argument
84 this.crc = crc; in ZipEntry()
148 crc = e.crc; in ZipEntry()
411 public void setCrc(long crc) { in setCrc() argument
412 if (crc < 0 || crc > 0xFFFFFFFFL) { in setCrc()
415 this.crc = crc; in setCrc()
427 return crc; in getCrc()
DGZIPInputStream.java48 protected CRC32 crc = new CRC32(); field in GZIPInputStream
125 crc.update(buf, off, n); in read()
162 CheckedInputStream in = new CheckedInputStream(this_in, crc); in readHeader()
163 crc.reset(); in readHeader()
197 int v = (int)crc.getValue() & 0xffff; in readHeader()
203 crc.reset(); in readHeader()
223 if ((readUInt(in) != crc.getValue()) || in readTrailer()
DZipOutputStream.java75 private CRC32 crc = new CRC32(); field in ZipOutputStream
210 if (e.size == -1 || e.csize == -1 || e.crc == -1) in putNextEntry()
225 if (e.size == -1 || e.crc == -1) { in putNextEntry()
271 if (e.crc != crc.getValue()) { in closeEntry()
274 Long.toHexString(e.crc) + " but got 0x" + in closeEntry()
275 Long.toHexString(crc.getValue()) + ")"); in closeEntry()
280 e.crc = crc.getValue(); in closeEntry()
293 if (e.crc != crc.getValue()) { in closeEntry()
296 Long.toHexString(e.crc) + " but got 0x" + in closeEntry()
297 Long.toHexString(crc.getValue()) + ")"); in closeEntry()
[all …]
DGZIPOutputStream.java42 protected CRC32 crc = new CRC32(); field in GZIPOutputStream
95 crc.reset(); in GZIPOutputStream()
146 crc.update(buf, off, len); in write()
201 writeInt((int)crc.getValue(), buf, offset); // CRC-32 of uncompr. data in writeTrailer()
DZipFile.java598 e.crc = getEntryCrc(jzentry); in getZipEntry()
/libcore/ojluni/src/main/native/
Djava_util_zip_CRC32.c40 CRC32_update(JNIEnv *env, jclass cls, jint crc, jint b) in CRC32_update() argument
45 return crc32(crc, buf, 1); in CRC32_update()
49 CRC32_updateBytes(JNIEnv *env, jclass cls, jint crc, in CRC32_updateBytes() argument
54 crc = crc32(crc, buf + off, len); in CRC32_updateBytes()
57 return crc; in CRC32_updateBytes()
61 ZIP_CRC32(jint crc, const jbyte *buf, jint len) in ZIP_CRC32() argument
63 return crc32(crc, (Bytef*)buf, len); in ZIP_CRC32()
67 CRC32_updateByteBuffer(JNIEnv *env, jclass cls, jint crc, in CRC32_updateByteBuffer() argument
72 crc = crc32(crc, buf + off, len); in CRC32_updateByteBuffer()
74 return crc; in CRC32_updateByteBuffer()
Dzip_util.h165 jint crc; /* crc of uncompressed data */ member
Djava_util_zip_ZipFile.c249 return (jlong)ze->crc & 0xffffffffUL; in ZipFile_getEntryCrc()
Dzip_util.c1054 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.java146 CRC32 crc = new CRC32(); in testStoredEntrySize() local
147 crc.update(buffer); in testStoredEntrySize()
148 outEntry.setCrc(crc.getValue()); in testStoredEntrySize()
263 CRC32 crc = new CRC32(); in testSTORED() local
299 ze.setCrc(crc.getValue()); in testSTORED()
309 ze.setCrc(crc.getValue()); in testSTORED()
329 ze.setCrc(crc.getValue()); in testSTORED()
349 ze.setCrc(crc.getValue()); in testSTORED()
360 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()