- if (line.startsWith("ZIP:")) {
- try {
- line = StringUtils.unbase64s(
- line.substring("ZIP:".length()), true);
- } catch (IOException e) {
- throw new IOException(
- "Internal error when decoding ZIP content: input may be corrupt");
+ boolean first = true;
+ while (stream.next()) {
+ if (stream.eof()) {
+ if (first) {
+ throw new NullPointerException(
+ "InputStream empty, normal termination");
+ }
+ return this;
+ }
+ first = false;
+
+ boolean zip = stream.startsWiths("ZIP:");
+ boolean b64 = stream.startsWiths("B64:");
+
+ if (zip || b64) {
+ stream.skip("XXX:".length());
+
+ InputStream decoded = stream.open();
+ if (zip) {
+ decoded = new GZIPInputStream(decoded);