public class UnicodeInputStreamReader extends Reader
InputStreamReader that is BOM-aware. It can
operate in any of the following modes:
| Constructor and Description |
|---|
UnicodeInputStreamReader(InputStream stream)
Creates a new reader over the given stream that uses the
default JVM charset.
|
UnicodeInputStreamReader(InputStream stream,
DecodingStrategy decodingStrategy)
Creates a new reader over the given stream that normally uses
the charset associated with a matching signature among those
of the given decoding strategy.
|
UnicodeInputStreamReader(InputStream stream,
SignatureCharset requestedSignatureCharset)
Creates a new reader over the given stream that normally
assumes the given signature is present and its associated
charset should be used.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
DecodingStrategy |
getDecodingStrategy()
Returns the receiver's decoding strategy.
|
SignatureCharset |
getRequestedSignatureCharset()
Returns the receiver's requested signature/charset.
|
SignatureCharset |
getSignatureCharset()
Returns the receiver's actual signature/charset (that is, the
one in use to decode the stream).
|
void |
mark(int readAheadLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(char[] cbuf) |
int |
read(char[] cbuf,
int off,
int len) |
int |
read(CharBuffer target) |
boolean |
ready() |
long |
skip(long n) |
public UnicodeInputStreamReader(InputStream stream)
stream - The stream.public UnicodeInputStreamReader(InputStream stream, SignatureCharset requestedSignatureCharset)
stream - The stream.requestedSignatureCharset - The signature/charset. It may
be null to use the default JVM charset.public UnicodeInputStreamReader(InputStream stream, DecodingStrategy decodingStrategy)
stream - The stream.decodingStrategy - The decoding strategy. It may be null
to use the default JVM charset.public int read(CharBuffer target) throws IOException
read in interface Readableread in class ReaderIOExceptionpublic int read()
throws IOException
read in class ReaderIOExceptionpublic int read(char[] cbuf)
throws IOException
read in class ReaderIOExceptionpublic int read(char[] cbuf,
int off,
int len)
throws IOException
read in class ReaderIOExceptionpublic long skip(long n)
throws IOException
skip in class ReaderIOExceptionpublic boolean ready()
throws IOException
ready in class ReaderIOExceptionpublic boolean markSupported()
markSupported in class Readerpublic void mark(int readAheadLimit)
throws IOException
mark in class ReaderIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOExceptionpublic DecodingStrategy getDecodingStrategy()
public SignatureCharset getRequestedSignatureCharset()
public SignatureCharset getSignatureCharset() throws IOException
IOException - Thrown if an I/O error occurs.Copyright © 2015. All Rights Reserved.