2_XMLStream

2_XMLStream - / / / / Date: 4/25/02 Author: Paul Robertson,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// Date: 4/25/02 // Author: Paul Robertson, Copyright (c) DOLL, Inc. // File: XMLStream.java // Description: XML Basic stream I/O support // Stream for reading and writing XML package mit16_410_13; import java.util.Vector; import java.io.InputStream; import java.io.PrintStream; import java.io.EOFException; import java.io.IOException; import java.io.FileInputStream; public class XMLStream { InputStream readfrom; PrintStream writeto; int ch; // one character lookahead public XMLStream (InputStream istrm) { readfrom=istrm; try { ch=istrm.read(); } catch (IOException e) { System.out.println("Can't read from XML input stream."); System.exit(1); } writeto=null; } public XMLStream (PrintStream ostrm) { writeto=ostrm; readfrom=null; } public XMLStream (InputStream istrm, PrintStream ostrm) { readfrom=istrm; try { ch=istrm.read(); } catch (IOException e) { System.out.println("Can't read from XML input stream."); System.exit(1); } writeto=ostrm; } public InputStream getInputStream () { return readfrom; } public PrintStream getPrintStream () { return writeto; }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/07/2011 for the course AERO 16.410 taught by Professor Brianwilliams during the Fall '05 term at MIT.

Page1 / 3

2_XMLStream - / / / / Date: 4/25/02 Author: Paul Robertson,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online