@Test void shouldReadShortList() { List<String> expected = Arrays.asList("asdf", "qwer", "zxcv", "asdf", "qwer", "zxcv", "asdf", "qwer", "zxcv", "asdf", "qwer"); List<Object> result = RLP.decodeToList(SHORT_LIST, (reader, list) -> { assertEquals(11, reader.remaining()); for (int i = 10; i >= 0; --i) { list.add(reader.readString()); } }); assertEquals(expected, result); }
@Override public int remaining() { int oldIndex = index; try { int count = 0; while (!isComplete()) { count++; skipNext(); } return count; } finally { index = oldIndex; } }
BytesRLPReader implements RLPReader { @Override public int remaining() { int oldIndex = index; try { int count = 0; while (!isComplete()) { count++; skipNext(); } return count; } finally { index = oldIndex; } } }
BytesRLPReader implements RLPReader { @Override public int remaining() { int oldIndex = index; try { int count = 0; while (!isComplete()) { count++; skipNext(); } return count; } finally { index = oldIndex; } } BytesRLPReader(Bytes content, boolean lenient); }
BytesRLPReader implements RLPReader { @Override public int remaining() { int oldIndex = index; try { int count = 0; while (!isComplete()) { count++; skipNext(); } return count; } finally { index = oldIndex; } } BytesRLPReader(Bytes content, boolean lenient); @Override boolean isLenient(); @Override Bytes readValue(boolean lenient); @Override boolean nextIsList(); @Override boolean nextIsEmpty(); @Override T readList(boolean lenient, Function<RLPReader, T> fn); @Override void skipNext(boolean lenient); @Override int remaining(); @Override boolean isComplete(); }
BytesRLPReader implements RLPReader { @Override public int remaining() { int oldIndex = index; try { int count = 0; while (!isComplete()) { count++; skipNext(); } return count; } finally { index = oldIndex; } } BytesRLPReader(Bytes content, boolean lenient); @Override boolean isLenient(); @Override Bytes readValue(boolean lenient); @Override boolean nextIsList(); @Override boolean nextIsEmpty(); @Override T readList(boolean lenient, Function<RLPReader, T> fn); @Override void skipNext(boolean lenient); @Override int remaining(); @Override boolean isComplete();  }