+ 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 = StringUtils.unbase64(stream.open(),
+ zip);
+ try {
+ read(decoded);
+ } finally {
+ decoded.close();
+ }
+ } else {
+ processLine(stream);