aboutsummaryrefslogtreecommitdiff
path: root/java/org/brotli/dec/BrotliInputStream.java
diff options
context:
space:
mode:
authorEugene Kliuchnikov <eustas@google.com>2019-04-12 13:57:42 +0200
committerGitHub <noreply@github.com>2019-04-12 13:57:42 +0200
commit4b2b2d4f83ffeaac7708e44409fe34896a01a278 (patch)
tree04dff6010a8fad91ba93eff45a8730ed5fc40f14 /java/org/brotli/dec/BrotliInputStream.java
parent9cd01c0437e8b6010434d3491a348a5645de624b (diff)
downloadbrotli-4b2b2d4f83ffeaac7708e44409fe34896a01a278.tar.gz
Update (#749)
Update: * Bazel: fix MSVC configuration * C: common: extended documentation and helpers around distance codes * C: common: enable BROTLI_DCHECK in "debug" builds * C: common: fix implicit trailing zero in `kPrefixSuffix` * C: dec: fix possible bit reader discharge for "large-window" mode * C: dec: simplify distance decoding via lookup table * C: dec: reuse decoder state members memory via union with lookup table * C: dec: add decoder state diagram * C: enc: clarify access to static dictionary * C: enc: improve static dictionary hash * C: enc: add "stream offset" parameter for parallel encoding * C: enc: reorganize hasher; now Q2-Q3 require exactly 256KiB to avoid global TCMalloc lock * C: enc: fix rare access to uninitialized data in ring-buffer * C: enc: reorganize logging / checks in `write_bits.h` * Java: dec: add "large-window" support * Java: dec: improve speed * Java: dec: debug and 32-bit mode are now activated via system properties * Java: dec: demystify some state variables (use better names) * Dictionary generator: add single input mode * Java: dec: modernize tests * Bazel: js: pick working commit for closure rules
Diffstat (limited to 'java/org/brotli/dec/BrotliInputStream.java')
-rw-r--r--java/org/brotli/dec/BrotliInputStream.java18
1 files changed, 6 insertions, 12 deletions
diff --git a/java/org/brotli/dec/BrotliInputStream.java b/java/org/brotli/dec/BrotliInputStream.java
index 5cc2e28..b99e40a 100644
--- a/java/org/brotli/dec/BrotliInputStream.java
+++ b/java/org/brotli/dec/BrotliInputStream.java
@@ -84,18 +84,12 @@ public class BrotliInputStream extends InputStream {
}
}
- public void setEager(boolean eager) {
- boolean isEager = (state.isEager != 0);
- if (eager == isEager) {
- /* Shortcut for no-op change. */
- return;
- }
- if (eager) {
- Decode.setEager(state);
- } else {
- /* Once decoder is "eager", there is no way back. */
- throw new IllegalStateException("Brotli decoder has been already switched to eager mode");
- }
+ public void enableEagerOutput() {
+ Decode.enableEagerOutput(state);
+ }
+
+ public void enableLargeWindow() {
+ Decode.enableLargeWindow(state);
}
/**