public class CharacterEscapingReader extends PushbackReader
in
Constructor and Description |
---|
CharacterEscapingReader(Reader in,
Collection<Character> charsToEscape)
Constructs a CharacterEscapingReader from an input reader and a
collection of characters to escape.
|
Modifier and Type | Method and Description |
---|---|
int |
read()
Reads a single character.
|
int |
read(char[] cbuf,
int off,
int len)
Reads characters into a portion of an array.
|
void |
unread(char[] buf)
This method always throws an
IOException |
void |
unread(char[] buf,
int off,
int len)
This method always throws an
IOException |
void |
unread(int c)
This method always throws an
IOException |
close, mark, markSupported, ready, reset, skip
public CharacterEscapingReader(Reader in, Collection<Character> charsToEscape)
in
- The input readercharsToEscape
- The characters to escape in the input reader's streampublic int read() throws IOException
read
in class PushbackReader
IOException
- if an I/O error occurspublic int read(char[] cbuf, int off, int len) throws IOException
read
in class PushbackReader
cbuf
- - Destination bufferoff
- - Offset at which to start writing characterslen
- - Maximum number of characters to readIOException
- if an I/O error occurspublic void unread(int c) throws IOException
IOException
unread
in class PushbackReader
c
- The int value representing the character to be pushed backIOException
- alwayspublic void unread(char[] buf) throws IOException
IOException
unread
in class PushbackReader
buf
- Character array to push backIOException
- alwayspublic void unread(char[] buf, int off, int len) throws IOException
IOException
unread
in class PushbackReader
buf
- Character arrayoff
- Offset of first character to push backlen
- Number of characters to push backIOException
- alwaysCopyright © 2011-2015 IBM. All Rights Reserved.