SAX and I/O

SAX provides a fair amount of flexibility with respect to I/O handling of serialized XML documents. Wherever SAX expects I/O to occur, the InputSource utility class is used as an extended wrapper around the native I/O stream model (which in the case of Java is java.io.InputStream for byte-oriented I/O and java.io.Reader for character-oriented I/O). The following is the Java definition of InputSource:

 package org.xml.sax; public class InputSource { // fields and method implementations elided for clarity public InputSource(); public InputSource(String systemId); public InputSource(InputStream byteStream); public InputSource(Reader characterStream); public void setPublicId(String publicId); public String getPublicId(); public void ...

Get Essential XML: Beyond Markup now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.