public final class XmlHeaderAwareReader
extends java.io.Reader
Reader
that evaluates the XML header. It selects its encoding based on the encoding read with the XML
header of the provided InputStream
. The default encoding is UTF-8 and the version is 1.0 if the
stream does not contain an XML header or the attributes are not set within the header.Constructor and Description |
---|
XmlHeaderAwareReader(java.io.InputStream in)
Constructs an XmlHeaderAwareReader.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getEncoding() |
double |
getVersion() |
int |
hashCode() |
void |
mark(int readAheadLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(char[] cbuf) |
int |
read(char[] cbuf,
int offset,
int length) |
boolean |
ready() |
void |
reset() |
long |
skip(long n) |
java.lang.String |
toString() |
public XmlHeaderAwareReader(java.io.InputStream in) throws java.io.UnsupportedEncodingException, java.io.IOException
in
- the InputStream
java.io.UnsupportedEncodingException
- if the encoding is not supportedjava.io.IOException
- occurred while reading the XML headerpublic java.lang.String getEncoding()
InputStreamReader.getEncoding()
public double getVersion()
InputStreamReader.getEncoding()
public void mark(int readAheadLimit) throws java.io.IOException
mark
in class java.io.Reader
java.io.IOException
Reader.mark(int)
public boolean markSupported()
markSupported
in class java.io.Reader
Reader.markSupported()
public int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
Reader.read()
public int read(char[] cbuf, int offset, int length) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
Reader.read(char[], int, int)
public int read(char[] cbuf) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
Reader.read(char[])
public boolean ready() throws java.io.IOException
ready
in class java.io.Reader
java.io.IOException
Reader.ready()
public void reset() throws java.io.IOException
reset
in class java.io.Reader
java.io.IOException
Reader.reset()
public long skip(long n) throws java.io.IOException
skip
in class java.io.Reader
java.io.IOException
Reader.skip(long)
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Reader
java.io.IOException
Reader.close()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
Copyright © 2004–2015 XStream. All rights reserved.