org.openmdx.kernel.xml
Class AdaptiveInputStreamReader
java.lang.Object
java.io.Reader
org.openmdx.kernel.xml.AdaptiveInputStreamReader
- All Implemented Interfaces:
- Closeable, Readable
public class AdaptiveInputStreamReader
- extends Reader
The Adaptive Input Stream Reader has the following encoding priorities
- The constructor's
encoding argument
- A byte order mark
- An XML declaration's encoding attribute
- The platform's default encoding
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AdaptiveInputStreamReader
public AdaptiveInputStreamReader(InputStream in,
String encoding,
boolean byteOrderMarkAware,
boolean xmlDeclarationAware)
throws IOException
- Constructor
- Parameters:
in - encoding; - may be nullbyteOrderMarkAware - xmlDeclarationAware -
- Throws:
IOException
getEncoding
public String getEncoding()
- Returns:
getByteOrderMark
public String getByteOrderMark()
- Retrieve the byte order mark evaluation result.
- Returns:
- the byte order makr's encoding; or
null.
getXMLDclaration
public XMLDeclaration getXMLDclaration()
- The AdaptiveInputStreamReader does not keep a reference to the
XMLDeclaration returned by this method.
- Returns:
- a copy of the XML Declaration; or
null
mark
public void mark(int readAheadLimit)
throws IOException
- Overrides:
mark in class Reader
- Throws:
IOException
markSupported
public boolean markSupported()
- Overrides:
markSupported in class Reader
read
public int read()
throws IOException
- Overrides:
read in class Reader
- Throws:
IOException
read
public int read(char[] cbuf,
int off,
int len)
throws IOException
- Specified by:
read in class Reader
- Throws:
IOException
read
public int read(char[] cbuf)
throws IOException
- Overrides:
read in class Reader
- Throws:
IOException
ready
public boolean ready()
throws IOException
- Overrides:
ready in class Reader
- Throws:
IOException
reset
public void reset()
throws IOException
- Overrides:
reset in class Reader
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Overrides:
skip in class Reader
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Specified by:
close in class Reader
- Throws:
IOException
This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.