Package com.io7m.jeucreader
Class UnicodeCharacterReader
java.lang.Object
com.io7m.jeucreader.UnicodeCharacterReader
- All Implemented Interfaces:
UnicodeCharacterReaderPushBackType,UnicodeCharacterReaderType
public final class UnicodeCharacterReader
extends Object
implements UnicodeCharacterReaderPushBackType
The default implementation of
UnicodeCharacterReaderType.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConstruct a new character reader from the given reader.voidpushCodePoint(int c) Push the charactercto the stream.int
-
Constructor Details
-
UnicodeCharacterReader
Construct a new codepoint reader.- Parameters:
r- An existing reader
-
-
Method Details
-
newReader
Construct a new character reader from the given reader.- Parameters:
r- The original reader- Returns:
- A new reader
-
pushCodePoint
public void pushCodePoint(int c) Description copied from interface:UnicodeCharacterReaderPushBackTypePush the charactercto the stream.- Specified by:
pushCodePointin interfaceUnicodeCharacterReaderPushBackType- Parameters:
c- The character to be pushed
-
readCodePoint
- Specified by:
readCodePointin interfaceUnicodeCharacterReaderType- Returns:
- A single unicode code point, or
-1at end-of-stream. - Throws:
IOException- On I/O errorsInvalidSurrogatePair- If the character received after a high surrogate was not a low surrogate.MissingLowSurrogate- If an end-of-stream was encountered before the low surrogate of a surrogate pair was received.OrphanLowSurrogate- If a low surrogate was received outside of a high/low surrogate pair.
-