public abstract class ReadWriteTest {
public void run() throws Throwable {
final MarshallerFactory factory = new RiverMarshallerFactory();
final MarshallingConfiguration configuration = new MarshallingConfiguration();
configure(configuration);
final Marshaller marshaller = factory.createMarshaller(configuration);
final ByteArrayOutputStream baos = new ByteArrayOutputStream(10240);
marshaller.start(Marshalling.createByteOutput(baos));
runWrite(marshaller);
marshaller.finish();
final byte[] bytes = baos.toByteArray();