fix namespace from master merge
[nikiroo-utils.git] / src / be / nikiroo / utils / serial / Importer.java
index a017fabfd362ea3ad27f72e0a6305856db2e41a1..ad2d284904790214b2360fbee0bb35cbae66f29e 100644 (file)
@@ -7,8 +7,8 @@ import java.util.HashMap;
 import java.util.Map;
 
 import be.nikiroo.utils.IOUtils;
-import be.nikiroo.utils.NextableInputStream;
-import be.nikiroo.utils.NextableInputStreamStep;
+import be.nikiroo.utils.streams.NextableInputStream;
+import be.nikiroo.utils.streams.NextableInputStreamStep;
 import be.nikiroo.utils.StringUtils;
 
 /**
@@ -72,10 +72,10 @@ public class Importer {
                                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");
                        }
 
@@ -84,6 +84,7 @@ public class Importer {
                                boolean b64 = stream.startsWiths("B64:");
 
                                if (zip || b64) {
+                                       stream.skip("XXX:".length());
                                        InputStream decoded = StringUtils.unbase64(stream.open(),
                                                        zip);
                                        try {