Package org.snakeyaml.engine.v2.scanner
Class StreamReader
- java.lang.Object
-
- org.snakeyaml.engine.v2.scanner.StreamReader
-
public final class StreamReader extends Object
Reader: checks if code points are in allowed range. Returns '\0' when end of data has been reached.
-
-
Constructor Summary
Constructors Constructor Description StreamReader(Reader reader, LoadSettings loadSettings)Deprecated.use the other constructor with LoadSettings firstStreamReader(String stream, LoadSettings loadSettings)Deprecated.use the other constructor with LoadSettings firstStreamReader(LoadSettings loadSettings, Reader reader)StreamReader(LoadSettings loadSettings, String stream)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidforward()voidforward(int length)read the next length characters and move the pointer.intgetColumn()intgetIndex()intgetLine()Optional<Mark>getMark()static booleanisPrintable(int c)static booleanisPrintable(String data)intpeek()intpeek(int index)Peek the next index-th code pointStringprefix(int length)peek the next length code pointsStringprefixForward(int length)prefix(length) immediately followed by forward(length)
-
-
-
Constructor Detail
-
StreamReader
public StreamReader(Reader reader, LoadSettings loadSettings)
Deprecated.use the other constructor with LoadSettings first
-
StreamReader
public StreamReader(LoadSettings loadSettings, Reader reader)
-
StreamReader
public StreamReader(String stream, LoadSettings loadSettings)
Deprecated.use the other constructor with LoadSettings first
-
StreamReader
public StreamReader(LoadSettings loadSettings, String stream)
-
-
Method Detail
-
isPrintable
public static final boolean isPrintable(String data)
-
isPrintable
public static boolean isPrintable(int c)
-
forward
public void forward()
-
forward
public void forward(int length)
read the next length characters and move the pointer. if the last character is high surrogate one more character will be read- Parameters:
length- amount of characters to move forward
-
peek
public int peek()
-
peek
public int peek(int index)
Peek the next index-th code point- Parameters:
index- to peek- Returns:
- the next index-th code point
-
prefix
public String prefix(int length)
peek the next length code points- Parameters:
length- amount of the characters to peek- Returns:
- the next length code points
-
prefixForward
public String prefixForward(int length)
prefix(length) immediately followed by forward(length)- Parameters:
length- amount of characters to get- Returns:
- the next length code points
-
getColumn
public int getColumn()
-
getIndex
public int getIndex()
- Returns:
- current position as number (in characters) from the beginning of the stream
-
getLine
public int getLine()
-
-