Class EncodingPreservingStreamReader
- java.lang.Object
-
- com.levigo.jadice.server.mail.worker.internal.util.EncodingPreservingStreamReader
-
public class EncodingPreservingStreamReader extends Object
This stream reader is used to read single and double byte encoded input streams and additionally sets the correct Byte Order.
-
-
Constructor Summary
Constructors Constructor Description EncodingPreservingStreamReader(com.levigo.jadice.document.io.SeekableInputStream sis, String encoding, String needleString)
This stream reader is used to read single and double byte encoded input streams and additionally sets the correct Byte Order.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consume(int count)
Consume characters and move the reader position ahead.int
peek(int offset)
Peek forward and read the next few characters.int
read()
Reads characters for the stream.
-
-
-
Constructor Detail
-
EncodingPreservingStreamReader
public EncodingPreservingStreamReader(com.levigo.jadice.document.io.SeekableInputStream sis, String encoding, String needleString)
This stream reader is used to read single and double byte encoded input streams and additionally sets the correct Byte Order.- Parameters:
sis
- the stream that shall be read.encoding
- the encoding that has been determined for this stream.
-
-
Method Detail
-
read
public int read() throws IOException
Reads characters for the stream.- Returns:
- the read characters or -1 if eof is reached.
- Throws:
IOException
- If an I/O error occurs
-
peek
public int peek(int offset) throws IOException
Peek forward and read the next few characters.- Parameters:
offset
- offset of the character that shall be read relative to the current reader position.- Returns:
- the character.
- Throws:
IOException
- If an I/O error occurs
-
consume
public void consume(int count) throws IOException
Consume characters and move the reader position ahead.- Parameters:
count
- the number of chars that the reader position shall be moved ahead.- Throws:
IOException
- If an I/O error occurs
-
-