XML for Java Compatibility API 2.0.6

com.ibm.xml.parser
Class Source

java.lang.Object
  |
  +--com.ibm.xml.parser.Source

public class Source
extends java.lang.Object

Source is a data object that encapsulates whether a data source is byte-stream-oriented (InputStream) or character-stream-oriented (Reader).

Version:
Revision: 87 1.4 src/com/ibm/xml/parser/Source.java, parser, xml4j2, xml4j2_0_6
See Also:
InputStream, Reader

Constructor Summary
Source(java.io.InputStream inputStream)
          Constructor for byte-stream-oriented data.
Source(java.io.InputStream inputStream, java.lang.String encoding)
          Constructor for byte-stream-oriented data.
Source(java.io.Reader reader)
          Constructor for character-stream-oriented data.
 
Method Summary
 java.lang.String getEncoding()
          Returns the Java character encoding in use for the inputStream.
 java.io.InputStream getInputStream()
          Returns the byte-stream-oriented data source.
 java.io.Reader getReader()
          Returns the character-stream-oriented data source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Source

public Source(java.io.InputStream inputStream)
Constructor for byte-stream-oriented data.
Parameters:
inputStream - Byte-stream-oriented data source.

Source

public Source(java.io.InputStream inputStream,
              java.lang.String encoding)
Constructor for byte-stream-oriented data.
Parameters:
inputStream - Byte-stream-oriented data source.
encoding - Java character encoding to use, or null.
See Also:
getEncoding()

Source

public Source(java.io.Reader reader)
Constructor for character-stream-oriented data.
Parameters:
reader - Character-stream-oriented data source.
Method Detail

getInputStream

public java.io.InputStream getInputStream()
Returns the byte-stream-oriented data source.
Returns:
Byte-stream-oriented data source.
See Also:
getReader()

getEncoding

public java.lang.String getEncoding()
Returns the Java character encoding in use for the inputStream. This value has no meaning when the source is character-stream-oriented.
Returns:
Java encoding in use by the byte-stream-oriented source, or null if not specified.

getReader

public java.io.Reader getReader()
Returns the character-stream-oriented data source.
Returns:
Character-stream-oriented data source.
See Also:
getInputStream()

XML for Java Compatibility API 2.0.6