mirror of
https://github.com/xerial/snappy-java.git
synced 2025-04-08 19:35:08 +02:00
Add test code for reading Snappy.compress result with SnappyInputStream
This commit is contained in:
parent
58016fd78d
commit
67e7cb57fd
@ -35,7 +35,6 @@ import java.io.InputStream;
|
||||
import org.junit.Test;
|
||||
import org.xerial.util.FileResource;
|
||||
import org.xerial.util.log.Logger;
|
||||
import scala.Array;
|
||||
|
||||
public class SnappyInputStreamTest
|
||||
{
|
||||
@ -193,4 +192,16 @@ public class SnappyInputStreamTest
|
||||
assertArrayEquals(orig1, uncompressed1);
|
||||
assertArrayEquals(orig2, uncompressed2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readSnappyCompressResult()
|
||||
throws Exception
|
||||
{
|
||||
byte[] orig = readResourceFile("alice29.txt");
|
||||
byte[] compressed = Snappy.compress(orig);
|
||||
SnappyInputStream in = new SnappyInputStream(new ByteArrayInputStream(compressed));
|
||||
byte[] uncompressed = readFully(in);
|
||||
|
||||
assertArrayEquals(orig, uncompressed);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user