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=