Ejemplo n.º 1
1
  /** This method is a hack. I really want another constructor. */
  public static Obj3d parseFile(InputStream is, ModelViewer modelViewer, boolean register)
      throws IOException, FileFormatException {

    StreamTokenizer st = new StreamTokenizer(new BufferedReader(new InputStreamReader(is)));
    st.eolIsSignificant(true);
    st.commentChar('#');

    Obj3d obj3d = new Obj3d(st, modelViewer, register);

    // should be at end of file
    is.close();
    if (st.ttype != StreamTokenizer.TT_EOF) {
      throw new FileFormatException(is.toString());
    }
    return obj3d;
  }
Ejemplo n.º 2
1
  public DBaseFile(InputStream is) {
    if (is == null) {
      String message = Logging.getMessage("nullValue.InputStreamIsNull");
      Logging.logger().severe(message);
      throw new IllegalArgumentException(message);
    }

    this.file = null;
    try {
      this.header = this.readHeaderFromStream(is);
      this.fields = this.readFieldsFromBuffer(this.header.fieldsHeaderBuffer);
      this.records = this.readRecordsFromStream(is);
    } catch (Exception e) {
      String message = Logging.getMessage("generic.ExceptionAttemptingToReadFrom", is.toString());
      Logging.logger().log(java.util.logging.Level.SEVERE, message, e);
      throw new WWRuntimeException(message, e);
    }
  }
Ejemplo n.º 3
1
 protected String getReaderURI() {
   if (inputURI != null) return inputURI;
   if (filename != null) return filename.toURI().toString();
   return schemaIn.toString();
 }