+ length += data.length();
+ if (!lineswereskipped)
+ {
+ for (int i = 0; !isBinary && i < data.length(); i++)
+ {
+ char c = data.charAt(i);
+ isBinary = (c < 32 && c != '\t' && c != '\n' && c != '\r'
+ && c != 5 && c != 27); // nominal binary character filter
+ // excluding CR, LF, tab,DEL and ^E
+ // for certain blast ids
+ }
+ }
+ if (isBinary)
+ {
+ // jar files are special - since they contain all sorts of random
+ // characters.
+ if (source.inFile != null)
+ {
+ String fileStr = source.inFile.getName();
+ // possibly a Jalview archive.
+ if (fileStr.lastIndexOf(".jar") > -1
+ || fileStr.lastIndexOf(".zip") > -1)
+ {
+ reply = "Jalview";
+ }
+ }
+ if (!lineswereskipped && data.startsWith("PK"))
+ {
+ reply = "Jalview"; // archive.
+ break;
+ }
+ }