JAL-3365 expand range of allowed DSSP secondary structure symbols in Stockholm files
[jalview.git] / src / jalview / io / FileParse.java
index d986dc5..2dec559 100755 (executable)
@@ -41,7 +41,7 @@ import jalview.api.AlignExportSettingsI;
 import jalview.api.AlignViewportI;
 import jalview.api.AlignmentViewPanel;
 import jalview.api.FeatureSettingsModelI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
 
@@ -225,24 +225,23 @@ public class FileParse
   {
     if (!input.markSupported())
     {
-      Cache.log.error(
+      Console.error(
               "FileParse.izGzipStream: input stream must support mark/reset");
       return false;
     }
     input.mark(4);
-    byte[] bytes = new byte[2]; // input.readNBytes(2);
+
+    // get first 2 bytes or return false
+    byte[] bytes = new byte[2];
     int read = input.read(bytes);
     input.reset();
     if (read != bytes.length)
     {
       return false;
     }
-    if (bytes.length == 2)
-    {
-      int header = (bytes[0] & 0xff) | ((bytes[1] << 8) & 0xff00);
-      return (GZIPInputStream.GZIP_MAGIC == header);
-    }
-    return false;
+
+    int header = (bytes[0] & 0xff) | ((bytes[1] << 8) & 0xff00);
+    return (GZIPInputStream.GZIP_MAGIC == header);
   }
 
   /**