X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=unused%2Fxml%2Fsax%2Fdemo%2FByteStreamDemo.java;fp=unused%2Fxml%2Fsax%2Fdemo%2FByteStreamDemo.java;h=5da34b97511e6fb66e2bbc652bfc6b947ee46571;hb=57cbf4f8080f1a8351cbee142a24b587133807ee;hp=0000000000000000000000000000000000000000;hpb=bea0afa3f198996432fc2598c83640829fb45b26;p=jalview.git diff --git a/unused/xml/sax/demo/ByteStreamDemo.java b/unused/xml/sax/demo/ByteStreamDemo.java new file mode 100644 index 0000000..5da34b9 --- /dev/null +++ b/unused/xml/sax/demo/ByteStreamDemo.java @@ -0,0 +1,78 @@ +package org.xml.sax.demo; +// SAX demonstration for parsing from a raw byte stream. +// No warranty; no copyright -- use this as you will. +// $Id: ByteStreamDemo.java,v 1.4 1998/05/01 20:38:19 david Exp $ + +import org.xml.sax.Parser; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import org.xml.sax.helpers.ParserFactory; + +import java.io.FileInputStream; + + + +/** + * Demonstrate parsing from a byte stream. + * + *
Usage: java -Dorg.xml.sax.parser=CLASSNAME ByteStreamDemo + * FILE
+ * + *The SAX parser will open a byte stream to the file name + * provided. Note the use of the InputStreamAdapter class to allow a + * Java InputStream to serve as a SAX ByteStream.
+ * + * @see DemoHandler + */ +public class ByteStreamDemo { + + + /** + * Main entry point. + */ + public static void main (String args[]) + throws Exception + { + Parser parser; + InputSource source; + DemoHandler handler; + FileInputStream input; + + // First, check the command-line usage. + if (args.length != 1) { + System.err.println("Usage: java -Dorg.xml.sax.parser=