@Test
//Test InMemoryWriter
public void testInMemoryWriter() throws IOException {
InMemoryWriter writer = null;
BoundedByteArrayOutputStream bout = new BoundedByteArrayOutputStream(1024 * 1024);
List<KVPair> data = KVDataGen.generateTestData(true, 0);
//No RLE, No RepeatKeys, no compression
writer = new InMemoryWriter(bout);
writeTestFileUsingDataBuffer(writer, false, false, data, null);
readUsingInMemoryReader(bout.getBuffer(), data);
//No RLE, RepeatKeys, no compression
bout.reset();
writer = new InMemoryWriter(bout);
writeTestFileUsingDataBuffer(writer, false, true, data, null);
readUsingInMemoryReader(bout.getBuffer(), data);
//RLE, No RepeatKeys, no compression
bout.reset();
writer = new InMemoryWriter(bout);
writeTestFileUsingDataBuffer(writer, true, false, data, null);
readUsingInMemoryReader(bout.getBuffer(), data);
//RLE, RepeatKeys, no compression
bout.reset();
writer = new InMemoryWriter(bout);
writeTestFileUsingDataBuffer(writer, true, true, data, null);
readUsingInMemoryReader(bout.getBuffer(), data);
}