public final class XmlHeaderAwareReader extends 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(InputStream in)
Constructs an XmlHeaderAwareReader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
equals(Object obj) |
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) |
String |
toString() |
public XmlHeaderAwareReader(InputStream in) throws UnsupportedEncodingException, IOException
in - the InputStreamUnsupportedEncodingException - if the encoding is not supportedIOException - occurred while reading the XML headerpublic String getEncoding()
InputStreamReader.getEncoding()public double getVersion()
InputStreamReader.getEncoding()public void mark(int readAheadLimit)
throws IOException
mark in class ReaderIOExceptionReader.mark(int)public boolean markSupported()
markSupported in class ReaderReader.markSupported()public int read()
throws IOException
read in class ReaderIOExceptionReader.read()public int read(char[] cbuf,
int offset,
int length)
throws IOException
read in class ReaderIOExceptionReader.read(char[], int, int)public int read(char[] cbuf)
throws IOException
read in class ReaderIOExceptionReader.read(char[])public boolean ready()
throws IOException
ready in class ReaderIOExceptionReader.ready()public void reset()
throws IOException
reset in class ReaderIOExceptionReader.reset()public long skip(long n)
throws IOException
skip in class ReaderIOExceptionReader.skip(long)public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOExceptionReader.close()public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public String toString()
toString in class ObjectObject.toString()Copyright © 2021 Internet2. All rights reserved.