Class DecodingReader
java.lang.Object
java.io.Reader
java.io.FilterReader
java.io.PushbackReader
org.armedbear.lisp.util.DecodingReader
- All Implemented Interfaces:
Closeable, AutoCloseable, Readable
Class to support mid-stream change of character encoding
to support setExternalFormat operation in Stream.java
Note: extends PushbackReader, but only for its interface;
all methods are overridden.
-
Field Summary
Fields inherited from class FilterReader
in -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()final CharsetGet the Charset used to decode bytes from the input stream.final voidmark(int readAheadLimit) final booleanfinal intread()final intread(char[] cbuf) final intread(char[] cbuf, int off, int len) final intread(CharBuffer cb) final booleanready()final voidreset()final voidsetCharset(Charset cs) Change the Charset used to decode bytes from the input stream into characters.final longskip(long n) Skips 'n' characters, or as many as can be read off the stream before its end.final voidunread(char[] cbuf) final voidunread(char[] cbuf, int off, int len) Unread the character array into the reader.final voidunread(int c) Unread a single code point.Methods inherited from class Reader
nullReader, of, readAllAsString, readAllLines, transferTo
-
Constructor Details
-
DecodingReader
-
-
Method Details
-
setCharset
Change the Charset used to decode bytes from the input stream into characters. -
getCharset
Get the Charset used to decode bytes from the input stream. -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classPushbackReader- Throws:
IOException
-
mark
- Overrides:
markin classPushbackReader- Throws:
IOException
-
markSupported
public final boolean markSupported()- Overrides:
markSupportedin classPushbackReader
-
ready
- Overrides:
readyin classPushbackReader- Throws:
IOException
-
reset
- Overrides:
resetin classPushbackReader- Throws:
IOException
-
skip
Skips 'n' characters, or as many as can be read off the stream before its end. Returns the number of characters actually skipped- Overrides:
skipin classPushbackReader- Throws:
IOException
-
unread
Unread a single code point. Decomposes the code point into UTF-16 surrogate pairs and unreads them using the char[] unreader function.- Overrides:
unreadin classPushbackReader- Throws:
IOException
-
unread
Unread the character array into the reader. Decodes the characters in the array into bytes, allowing the encoding to be changed before reading from the stream again, using a different charset.- Overrides:
unreadin classPushbackReader- Throws:
IOException
-
unread
- Overrides:
unreadin classPushbackReader- Throws:
IOException
-
read
- Overrides:
readin classPushbackReader- Throws:
IOException
-
read
- Overrides:
readin classPushbackReader- Throws:
IOException
-
read
- Specified by:
readin interfaceReadable- Overrides:
readin classReader- Throws:
IOException
-
read
- Overrides:
readin classReader- Throws:
IOException
-