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=0000000000000000000000000000000000000000;hb=4f77328104498504339216829abf5ea87e2791ec;hp=5da34b97511e6fb66e2bbc652bfc6b947ee46571;hpb=2b8c0785318a3528e1876e8e2dd48b7d831eae69;p=jalview.git diff --git a/unused/xml/sax/demo/ByteStreamDemo.java b/unused/xml/sax/demo/ByteStreamDemo.java deleted file mode 100644 index 5da34b9..0000000 --- a/unused/xml/sax/demo/ByteStreamDemo.java +++ /dev/null @@ -1,78 +0,0 @@ -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= " + - "SystemIdDemo "); - System.exit(2); - } - - // Allocate a SAX Parser object, using - // the class name provided in the - // org.xml.sax.parser property. - parser = ParserFactory.makeParser(); - - // Allocate an event handler, and register - // it with the SAX parser for all four - // types of events (we could use a - // separate object for each). - handler = new DemoHandler(); - parser.setEntityResolver(handler); - parser.setDTDHandler(handler); - parser.setDocumentHandler(handler); - parser.setErrorHandler(handler); - - // Create a Java FileInputStream from - // the file: note that SAX cannot - // use this directly. - input = new FileInputStream(args[0]); - - // Create the input source. - source = new InputSource(input); - source.setSystemId(args[0]); - - // Parse the document from the - // ByteStream. - parser.parse(source); - } - -}