public class EscapeControlCharsReader
extends java.io.FilterReader
Modifier and Type | Field and Description |
---|---|
private java.util.LinkedList<java.lang.Character> |
buffer
A buffer which holds the characters temporarily, as ISO control characters are escaped.
|
Constructor and Description |
---|
EscapeControlCharsReader(java.io.Reader in)
Create a new instance for the specified reader.
|
Modifier and Type | Method and Description |
---|---|
int |
read()
Read the next character from the stream.
|
int |
read(char[] cbuf,
int off,
int len)
Read a bunch of characters from the stream.
|
private java.util.LinkedList<java.lang.Character> buffer
public EscapeControlCharsReader(java.io.Reader in)
in
- public int read() throws java.io.IOException
If the next character is a non-whitespace ISO control character, the escape sequence will be added to
the buffer
and characters will be polled from it until is emptied.
read
in class java.io.FilterReader
java.io.IOException
public int read(char[] cbuf, int off, int len) throws java.io.IOException
Any non-whitespace ISO control character which was read will be escaped and buffer
will be
populated with the entire chunk of characters, including the escape sequences. The buffer will be used
until is emptied.
read
in class java.io.FilterReader
cbuf
- The array where to hold the read characters.off
- The offset in the array.len
- The maximum number of characters to be read.java.io.IOException