org.enhydra.xml.io
Class InputSourceOps

java.lang.Object
  |
  +--org.enhydra.xml.io.InputSourceOps

public final class InputSourceOps
extends Object

Various operations on InputSources.


Method Summary
static void close(InputSource input)
          Close an InputSource, if open.
static void closeIfOpened(InputSource inputSource, Reader reader)
          Close a byte stream returned by open(), only if it was actually opened by open.
static String getName(InputSource input)
          Get a description of an input source.
static boolean isOpen(InputSource input)
          Determine if an input source has an open byte or character stream.
static boolean isXMLDocument(InputSource inputSource)
          Determine an input source points to an XML document.
static boolean isXMLDocument(Reader reader)
          Determine an document reader is attached to an XML document by checking the first few bytes.
static Reader open(InputSource inputSource)
          Open a character input stream for an input source if one is not already open.
static InputStream openSystemId(String systemId)
          Open a bytestream given a system id.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

openSystemId

public static InputStream openSystemId(String systemId)
                                throws IOException
Open a bytestream given a system id.

open

public static Reader open(InputSource inputSource)
                   throws IOException
Open a character input stream for an input source if one is not already open.
Parameters:
inputSource - Specification of the document to open.
Returns:
A pointer to the character stream.

isOpen

public static boolean isOpen(InputSource input)
Determine if an input source has an open byte or character stream.

close

public static void close(InputSource input)
                  throws IOException
Close an InputSource, if open.

closeIfOpened

public static void closeIfOpened(InputSource inputSource,
                                 Reader reader)
                          throws IOException
Close a byte stream returned by open(), only if it was actually opened by open.
Parameters:
inputSource - Specification of the document that was opened.
reader - The character stream returned by open.

getName

public static String getName(InputSource input)
Get a description of an input source.

isXMLDocument

public static boolean isXMLDocument(Reader reader)
                             throws IOException
Determine an document reader is attached to an XML document by checking the first few bytes. Reader must be positioned at the start.
Parameters:
reader - Character stream.

isXMLDocument

public static boolean isXMLDocument(InputSource inputSource)
                             throws IOException
Determine an input source points to an XML document.
Parameters:
inputSource - Specification of the document to examine.


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.