uxparser
Class XInputStreamReader

java.lang.Object
  extended by java.io.Reader
      extended by uxparser.XInputStreamReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class XInputStreamReader
extends java.io.Reader

XInputStreamRead is used to read a XML byte stream into a stream of unicode characters. Mapping the byte stream into a charset encoding is implemented according XML 1.0 Appendix F - Autodetection of Character Encodings. XInputStream also automatically handles reading a PKZIP zipped XML. Character encodings supported:


Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
XInputStreamReader(java.io.InputStream in)
          Construct writer for specified file.
 
Method Summary
 void close()
          Close the underlying input stream.
 java.lang.String getEncoding()
          Get the character encoding being used.
 boolean isZipped()
          Return if the stream was zipped.
static void main(java.lang.String[] args)
           
 int read()
          Read one character.
 int read(char[] buf)
          Read a block of characters into the specified buffer.
 int read(char[] buf, int off, int len)
          Read a block of characters into the specified buffer.
 
Methods inherited from class java.io.Reader
mark, markSupported, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XInputStreamReader

public XInputStreamReader(java.io.InputStream in)
                   throws java.io.IOException
Construct writer for specified file.

Throws:
java.io.IOException
Method Detail

getEncoding

public java.lang.String getEncoding()
                             throws java.io.IOException
Get the character encoding being used.

Throws:
java.io.IOException

isZipped

public boolean isZipped()
                 throws java.io.IOException
Return if the stream was zipped.

Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Read one character.

Overrides:
read in class java.io.Reader
Throws:
java.io.IOException

read

public int read(char[] buf,
                int off,
                int len)
         throws java.io.IOException
Read a block of characters into the specified buffer.

Specified by:
read in class java.io.Reader
Throws:
java.io.IOException

read

public int read(char[] buf)
         throws java.io.IOException
Read a block of characters into the specified buffer.

Overrides:
read in class java.io.Reader
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close the underlying input stream.

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Reader
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception