import java.util.Map;
import be.nikiroo.utils.IOUtils;
-import be.nikiroo.utils.NextableInputStream;
-import be.nikiroo.utils.NextableInputStreamStep;
import be.nikiroo.utils.StringUtils;
+import be.nikiroo.utils.streams.NextableInputStream;
+import be.nikiroo.utils.streams.NextableInputStreamStep;
/**
* A simple class that can accept the output of {@link Exporter} to recreate
* content, or a number of lines of it (any given line <b>MUST</b> be
* complete though) and accumulate it with the already present data.
*
- * @param data
+ * @param in
* the data to parse
*
* @return itself so it can be chained
new NextableInputStreamStep('\n'));
try {
- if (in == null || stream.eof()) {
- if (in == null) {
- throw new NullPointerException("InputStream is null");
- }
+ if (in == null) {
+ throw new NullPointerException("InputStream is null");
+ }
+ if (stream.eof()) {
throw new NullPointerException("InputStream is empty");
}
boolean b64 = stream.startsWiths("B64:");
if (zip || b64) {
+ stream.skip("XXX:".length());
InputStream decoded = StringUtils.unbase64(stream.open(),
zip);
try {
* Read a single (whole) line of serialised data into this {@link Importer}
* and accumulate it with the already present data.
*
- * @param line
+ * @param in
* the line to parse
*
* @return TRUE if we are just done with one object or sub-object