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 InputStream
UnsupportedEncodingException
- 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 Reader
IOException
Reader.mark(int)
public boolean markSupported()
markSupported
in class Reader
Reader.markSupported()
public int read() throws IOException
read
in class Reader
IOException
Reader.read()
public int read(char[] cbuf, int offset, int length) throws IOException
read
in class Reader
IOException
Reader.read(char[], int, int)
public int read(char[] cbuf) throws IOException
read
in class Reader
IOException
Reader.read(char[])
public boolean ready() throws IOException
ready
in class Reader
IOException
Reader.ready()
public void reset() throws IOException
reset
in class Reader
IOException
Reader.reset()
public long skip(long n) throws IOException
skip
in class Reader
IOException
Reader.skip(long)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Reader
IOException
Reader.close()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public String toString()
toString
in class Object
Object.toString()
Copyright © 2016 Internet2. All rights reserved.