Class ReaderInput
java.lang.Object
com.electronwill.nightconfig.core.io.AbstractInput
com.electronwill.nightconfig.core.io.ReaderInput
- All Implemented Interfaces:
CharacterInput
An implementation of
CharacterInput based on a Reader.-
Field Summary
Fields inherited from class com.electronwill.nightconfig.core.io.AbstractInput
deque -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intTries to parse the next character without taking care of the peek deque.protected charTries to parse the next character without taking care of the peek deque.read(int n) Reads the next n characters, if possible.readChars(int n) Reads the next n characters.Methods inherited from class com.electronwill.nightconfig.core.io.AbstractInput
consumeDeque, peek, peek, peekChar, peekChar, pushBack, read, readChar, readCharsUntil, readUntil, skipPeeksMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.electronwill.nightconfig.core.io.CharacterInput
readAndSkip, readCharAndSkip
-
Constructor Details
-
ReaderInput
-
-
Method Details
-
directRead
protected int directRead()Description copied from class:AbstractInputTries to parse the next character without taking care of the peek deque.- Specified by:
directReadin classAbstractInput- Returns:
- the next character, or -1 if the EOS has been reached
-
directReadChar
Description copied from class:AbstractInputTries to parse the next character without taking care of the peek deque.- Specified by:
directReadCharin classAbstractInput- Returns:
- the next character
- Throws:
ParsingException- if the EOS has been reached
-
read
Description copied from interface:CharacterInputReads the next n characters, if possible. If there are less than n available characters, return all the remaining characters.- Parameters:
n- the number of characters to parse- Returns:
- an array containing at most n characters, not null
-
readChars
Description copied from interface:CharacterInputReads the next n characters. If there isn't n available characters, this method throws an exception.- Parameters:
n- the number of characters to parse- Returns:
- an array containing the next n characters, not null
-