type.encode(buff, Bytes.toBytes("hello foobar!"));
}
@Test
public void testReadWriteSkippable() {
PositionedByteRange buff = new SimplePositionedByteRange(14);
for (OrderedString t : new OrderedString[] {
OrderedString.ASCENDING, OrderedString.DESCENDING
}) {
for (byte[] term : TERMINATORS) {
for (String val : VALUES_STRINGS) {
buff.setPosition(0);
DataType<String> type = new TerminatedWrapper<String>(t, term);
assertEquals(val.length() + 2 + term.length, type.encode(buff, val));
buff.setPosition(0);
assertEquals(val, type.decode(buff));
assertEquals(val.length() + 2 + term.length, buff.getPosition());
}
}
}
}