gzip compressoin test

This commit is contained in:
Adam
2015-10-17 14:23:54 -04:00
parent 723a48c903
commit 52e631b74e
2 changed files with 20 additions and 8 deletions

View File

@@ -50,4 +50,18 @@ public class DataFileTest
Assert.assertArrayEquals(b, buf);
file.delete();
}
@Test
public void testGZipCompression() throws IOException
{
try (Store store = new Store(folder.getRoot()))
{
DataFile df = new DataFile(store, folder.newFile());
DataFileWriteResult res = df.write(41, 4, ByteBuffer.wrap("test".getBytes()), 2, 0);
DataFileReadResult res2 = df.read(41, 4, res.sector, res.compressedLength);
byte[] buf = res2.data;
String str = new String(buf);
Assert.assertEquals("test", str);
}
}
}