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 InputStreamjava.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.Readerjava.io.IOExceptionReader.mark(int)public boolean markSupported()
markSupported in class java.io.ReaderReader.markSupported()public int read()
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionReader.read()public int read(char[] cbuf,
int offset,
int length)
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionReader.read(char[], int, int)public int read(char[] cbuf)
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionReader.read(char[])public boolean ready()
throws java.io.IOException
ready in class java.io.Readerjava.io.IOExceptionReader.ready()public void reset()
throws java.io.IOException
reset in class java.io.Readerjava.io.IOExceptionReader.reset()public long skip(long n)
throws java.io.IOException
skip in class java.io.Readerjava.io.IOExceptionReader.skip(long)public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Readerjava.io.IOExceptionReader.close()public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()Copyright © 2004–2024 XStream. All rights reserved.