bndlib fixes
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1363873 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/aQute/lib/json/Decoder.java b/bundleplugin/src/main/java/aQute/lib/json/Decoder.java
index 09b6a7f..87cd1bc 100644
--- a/bundleplugin/src/main/java/aQute/lib/json/Decoder.java
+++ b/bundleplugin/src/main/java/aQute/lib/json/Decoder.java
@@ -4,6 +4,7 @@
import java.lang.reflect.*;
import java.security.*;
import java.util.*;
+import java.util.zip.*;
import aQute.lib.converter.*;
@@ -16,6 +17,7 @@
String encoding = "UTF-8";
boolean strict;
+ boolean inflate;
Decoder(JSONCodec codec) {
this.codec = codec;
@@ -26,6 +28,10 @@
}
public Decoder from(InputStream in) throws Exception {
+
+ if ( inflate)
+ in = new InflaterInputStream(in);
+
return from(new InputStreamReader(in, encoding));
}
@@ -140,4 +146,11 @@
extra = new HashMap<String,Object>();
return extra;
}
+
+ public Decoder inflate() {
+ if ( reader != null)
+ throw new IllegalStateException("Reader already set, inflate must come before from()");
+ inflate = true;
+ return this;
+ }
}