/** * Skip the VFF header, which consists of a variable number of LF-terminated * lines. The final line in the header is expected to be 0x0c0a. */ private void skipHeader(RandomAccessInputStream s) throws IOException { while (s.readLine().trim().length() > 0); }
/** * Skip the VFF header, which consists of a variable number of LF-terminated * lines. The final line in the header is expected to be 0x0c0a. */ private void skipHeader(RandomAccessInputStream s) throws IOException { while (s.readLine().trim().length() > 0); }
@Override public boolean isThisType(RandomAccessInputStream stream) throws IOException { if (!FormatTools.validStream(stream, 50, false)) return false; String c = stream.readLine(); Matcher amiraMeshDef = Pattern.compile("#\\s+(AmiraMesh|Avizo).*?" + "(BINARY|ASCII)(-LITTLE-ENDIAN)*").matcher(c); return amiraMeshDef.find(); }
@Override public boolean isThisType(RandomAccessInputStream stream) throws IOException { if (!FormatTools.validStream(stream, 50, false)) return false; String c = stream.readLine(); Matcher amiraMeshDef = Pattern.compile("#\\s+(AmiraMesh|Avizo).*?" + "(BINARY|ASCII)(-LITTLE-ENDIAN)*").matcher(c); return amiraMeshDef.find(); }
protected void readFile(RandomAccessInputStream inputStream) throws FormatException, IOException { String firstLine = inputStream.readLine(); Matcher amiraMeshDef = Pattern.compile("#\\s+(AmiraMesh|Avizo).*?" + "(BINARY|ASCII)(-LITTLE-ENDIAN)*").matcher(firstLine); if (amiraMeshDef.find()) { if (amiraMeshDef.group(2).equals("BINARY")) { littleEndian = amiraMeshDef.group(3) != null; } else if (amiraMeshDef.group(2).equals("ASCII")) { ascii = true; } else { syntaxError("Can't recognise this Amira file type"); } } else { syntaxError("Doesn't seem to be an Amira file"); } column = 0; row = 1; in = inputStream; readByte(); readTopLevel(); extractCoreMetaData(); }
protected void readFile(RandomAccessInputStream inputStream) throws FormatException, IOException { String firstLine = inputStream.readLine(); Matcher amiraMeshDef = Pattern.compile("#\\s+(AmiraMesh|Avizo).*?" + "(BINARY|ASCII)(-LITTLE-ENDIAN)*").matcher(firstLine); if (amiraMeshDef.find()) { if (amiraMeshDef.group(2).equals("BINARY")) { littleEndian = amiraMeshDef.group(3) != null; } else if (amiraMeshDef.group(2).equals("ASCII")) { ascii = true; } else { syntaxError("Can't recognise this Amira file type"); } } else { syntaxError("Doesn't seem to be an Amira file"); } column = 0; row = 1; in = inputStream; readByte(); readTopLevel(); extractCoreMetaData(); }
no++; time = checkTime(time, no, in.getFilePointer(), in.length()); String line = in.readLine(); if (line == null) break; // eof lines.add(line);
no++; time = checkTime(time, no, in.getFilePointer(), in.length()); String line = in.readLine(); if (line == null) break; // eof lines.add(line);
String line = in.readLine().trim(); line = line.replaceAll("[^0-9]", " "); StringTokenizer t = new StringTokenizer(line, " ");
String line = in.readLine().trim(); line = line.replaceAll("[^0-9]", " "); StringTokenizer t = new StringTokenizer(line, " ");
in.readLine(); lineNumber++;
in.readLine(); lineNumber++;
String date = in.readLine().trim(); int commentLength = (int) (240 - in.getFilePointer() + fp); String comment = in.readString(commentLength).trim();