@Test void shouldReadLongList() { List<List<String>> expected = Stream.generate(() -> Arrays.asList("asdf", "qwer", "zxcv")).limit(31).collect(Collectors.toList()); List<Object> result = RLP.decodeToList(LONG_LIST, (reader, list) -> { for (int i = 30; i >= 0; --i) { list.add(reader.readList((subReader, subList) -> { subList.add(subReader.readString()); subList.add(subReader.readString()); subList.add(subReader.readString()); })); } }); assertEquals(expected, result); }
@Override public <T> T readList(boolean lenient, Function<RLPReader, T> fn) { return fn.apply(new BytesRLPReader(readList(lenient), lenient)); }
BytesRLPReader implements RLPReader { @Override public <T> T readList(boolean lenient, Function<RLPReader, T> fn) { return fn.apply(new BytesRLPReader(readList(lenient), lenient)); } }
BytesRLPReader implements RLPReader { @Override public <T> T readList(boolean lenient, Function<RLPReader, T> fn) { return fn.apply(new BytesRLPReader(readList(lenient), lenient)); } BytesRLPReader(Bytes content, boolean lenient); }
BytesRLPReader implements RLPReader { @Override public <T> T readList(boolean lenient, Function<RLPReader, T> fn) { return fn.apply(new BytesRLPReader(readList(lenient), lenient)); } 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 <T> T readList(boolean lenient, Function<RLPReader, T> fn) { return fn.apply(new BytesRLPReader(readList(lenient), lenient)); } 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();  }