Package org.armedbear.lisp.util
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 java.io.FilterReader
in
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
final Charset
Get the Charset used to decode bytes from the input stream.final void
mark
(int readAheadLimit) final boolean
final int
read()
final int
read
(char[] cbuf) final int
read
(char[] cbuf, int off, int len) final int
read
(CharBuffer cb) final boolean
ready()
final void
reset()
final void
setCharset
(Charset cs) Change the Charset used to decode bytes from the input stream into characters.final long
skip
(long n) Skips 'n' characters, or as many as can be read off the stream before its end.final void
unread
(char[] cbuf) final void
unread
(char[] cbuf, int off, int len) Unread the character array into the reader.final void
unread
(int c) Unread a single code point.Methods inherited from class java.io.Reader
nullReader, 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classPushbackReader
- Throws:
IOException
-
mark
- Overrides:
mark
in classPushbackReader
- Throws:
IOException
-
markSupported
public final boolean markSupported()- Overrides:
markSupported
in classPushbackReader
-
ready
- Overrides:
ready
in classPushbackReader
- Throws:
IOException
-
reset
- Overrides:
reset
in 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:
skip
in 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:
unread
in 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:
unread
in classPushbackReader
- Throws:
IOException
-
unread
- Overrides:
unread
in classPushbackReader
- Throws:
IOException
-
read
- Overrides:
read
in classPushbackReader
- Throws:
IOException
-
read
- Overrides:
read
in classPushbackReader
- Throws:
IOException
-
read
- Specified by:
read
in interfaceReadable
- Overrides:
read
in classReader
- Throws:
IOException
-
read
- Overrides:
read
in classReader
- Throws:
IOException
-