@Test public void testPeekACharArray() { CodeReader reader = new CodeReader(new StringReader("bar")); char[] chars = reader.peek(2); assertThat(chars.length, is(2)); assertThat(chars[0], is('b')); assertThat(chars[1], is('a')); }
public final char[] peek(int length) { char[] result = new char[length]; int index = 0; int nextChar = intAt(index); while (nextChar != -1 && index < length) { result[index] = (char) nextChar; index++; nextChar = intAt(index); } return result; }
CodeReader extends CodeBuffer { public final char[] peek(int length) { char[] result = new char[length]; int index = 0; int nextChar = intAt(index); while (nextChar != -1 && index < length) { result[index] = (char) nextChar; index++; nextChar = intAt(index); } return result; } }
CodeReader extends CodeBuffer { public final char[] peek(int length) { char[] result = new char[length]; int index = 0; int nextChar = intAt(index); while (nextChar != -1 && index < length) { result[index] = (char) nextChar; index++; nextChar = intAt(index); } return result; } CodeReader(Reader code);  CodeReader(String code);  CodeReader(Reader code, CodeReaderConfiguration configuration);  CodeReader(String code, CodeReaderConfiguration configuration); }
CodeReader extends CodeBuffer { public final char[] peek(int length) { char[] result = new char[length]; int index = 0; int nextChar = intAt(index); while (nextChar != -1 && index < length) { result[index] = (char) nextChar; index++; nextChar = intAt(index); } return result; } CodeReader(Reader code);  CodeReader(String code);  CodeReader(Reader code, CodeReaderConfiguration configuration);  CodeReader(String code, CodeReaderConfiguration configuration); final void pop(Appendable appendable); final char[] peek(int length); final void peekTo(EndMatcher matcher, Appendable appendable); final int popTo(Matcher matcher, Appendable appendable); final int popTo(Matcher matcher, Matcher afterMatcher, Appendable appendable); final Cursor getPreviousCursor(); }
CodeReader extends CodeBuffer { public final char[] peek(int length) { char[] result = new char[length]; int index = 0; int nextChar = intAt(index); while (nextChar != -1 && index < length) { result[index] = (char) nextChar; index++; nextChar = intAt(index); } return result; } CodeReader(Reader code);  CodeReader(String code);  CodeReader(Reader code, CodeReaderConfiguration configuration);  CodeReader(String code, CodeReaderConfiguration configuration); final void pop(Appendable appendable); final char[] peek(int length); final void peekTo(EndMatcher matcher, Appendable appendable); final int popTo(Matcher matcher, Appendable appendable); final int popTo(Matcher matcher, Matcher afterMatcher, Appendable appendable); final Cursor getPreviousCursor();  }