aboutsummaryrefslogtreecommitdiff
path: root/java/org/brotli/dec/DictionaryTest.java
diff options
context:
space:
mode:
authorEugene Kliuchnikov <eustas@google.com>2017-05-29 17:55:14 +0200
committerGitHub <noreply@github.com>2017-05-29 17:55:14 +0200
commit03739d2b113afe60638069c4e1604dc2ac27380d (patch)
tree4ce3aa5ed7679b4a6f999dbad9483eb2f6cab7cb /java/org/brotli/dec/DictionaryTest.java
parent2c001010aa49b06de83bf28ec43be4fed8be3fbd (diff)
downloadbrotli-03739d2b113afe60638069c4e1604dc2ac27380d.zip
brotli-03739d2b113afe60638069c4e1604dc2ac27380d.tar.gz
brotli-03739d2b113afe60638069c4e1604dc2ac27380d.tar.bz2
Update (#555)
Update: * new CLI; bro -> brotli; + man page * JNI wrappers preparation (for bazel build) * add raw binary dictionary representation `dictionary.bin` * add ability to side-load brotli RFC dictionary * decoder persists last error now * fix `BrotliDecoderDecompress` documentation * go reader don't block until necessary * more consistent bazel target names * Java dictionary data compiled footprint reduced * Java tests refactoring
Diffstat (limited to 'java/org/brotli/dec/DictionaryTest.java')
-rwxr-xr-xjava/org/brotli/dec/DictionaryTest.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/java/org/brotli/dec/DictionaryTest.java b/java/org/brotli/dec/DictionaryTest.java
index cf5c1cd..b2ea04b 100755
--- a/java/org/brotli/dec/DictionaryTest.java
+++ b/java/org/brotli/dec/DictionaryTest.java
@@ -8,6 +8,7 @@ package org.brotli.dec;
import static org.junit.Assert.assertEquals;
+import java.nio.ByteBuffer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -18,10 +19,10 @@ import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class DictionaryTest {
- private static long crc64(byte[] data) {
+ private static long crc64(ByteBuffer data) {
long crc = -1;
- for (int i = 0; i < data.length; ++i) {
- long c = (crc ^ (long) (data[i] & 0xFF)) & 0xFF;
+ for (int i = 0; i < data.capacity(); ++i) {
+ long c = (crc ^ (long) (data.get(i) & 0xFF)) & 0xFF;
for (int k = 0; k < 8; k++) {
c = (c >>> 1) ^ (-(c & 1L) & -3932672073523589310L);
}