Package org.yaml.snakeyaml.reader
Class StreamReader
java.lang.Object
org.yaml.snakeyaml.reader.StreamReader
Reader: checks if code points are in allowed range. Returns '\0' when end of
data has been reached.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate char[]
private static final int
private int
private int
Real length of the data in dataWindowprivate int[]
Read data (as a moving window for input stream)private boolean
private int
index is only required to implement 1024 key length restriction http://yaml.org/spec/1.1/#simple key/ It must count code points, but it counts characters (to be fixed)private int
private String
private int
The variable points to the current position in the data arrayprivate final Reader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
private boolean
ensureEnoughData
(int size) void
forward()
void
forward
(int length) read the next length characters and move the pointer.int
int
getIndex()
int
getLine()
getMark()
static boolean
isPrintable
(int c) static boolean
isPrintable
(String data) int
peek()
int
peek
(int index) Peek the next index-th code pointprefix
(int length) peek the next length code pointsprefixForward
(int length) prefix(length) immediately followed by forward(length)private void
update()
-
Field Details
-
name
-
stream
-
dataWindow
private int[] dataWindowRead data (as a moving window for input stream) -
dataLength
private int dataLengthReal length of the data in dataWindow -
pointer
private int pointerThe variable points to the current position in the data array -
eof
private boolean eof -
index
private int indexindex is only required to implement 1024 key length restriction http://yaml.org/spec/1.1/#simple key/ It must count code points, but it counts characters (to be fixed) -
line
private int line -
column
private int column -
buffer
private char[] buffer -
BUFFER_SIZE
private static final int BUFFER_SIZE- See Also:
-
-
Constructor Details
-
StreamReader
-
StreamReader
-
-
Method Details
-
isPrintable
-
isPrintable
public static boolean isPrintable(int c) -
getMark
-
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
peek the next length code points- Parameters:
length
- amount of the characters to peek- Returns:
- the next length code points
-
prefixForward
prefix(length) immediately followed by forward(length)- Parameters:
length
- amount of characters to get- Returns:
- the next length code points
-
ensureEnoughData
private boolean ensureEnoughData() -
ensureEnoughData
private boolean ensureEnoughData(int size) -
update
private void update() -
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()
-