r.setField(i, new IntValue(i));
}
try {
// serialize and deserialize to remove all buffered info
r.write(new OutputViewDataOutputStreamWrapper(out));
r = new Record();
r.read(new InputViewDataInputStreamWrapper(in));
r.setField(1, new IntValue(10));
r.setField(4, new StringValue("Some long value"));
r.setField(5, new StringValue("An even longer value"));
r.setField(10, new IntValue(10));
r.write(new OutputViewDataOutputStreamWrapper(out));
r = new Record();
r.read(new InputViewDataInputStreamWrapper(in));
assertTrue(r.getField(0, IntValue.class).getValue() == 0);
assertTrue(r.getField(1, IntValue.class).getValue() == 10);