Created
August 1, 2020 23:37
-
-
Save andrealaforgia/d380228a6ac49f00a57b51f0ad796370 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
@Test | |
void shouldCompressAndDecompress() throws IOException { | |
whenCompressingData(); | |
thenDataIsCompressed(); | |
thenCompressedDataShouldBeCorrectlyDecompressed(); | |
andTheCompressionRatioIsPrintedOut(); | |
} | |
private void andTheCompressionRatioIsPrintedOut() { | |
long inputSize = TEST_DATA.getBytes().length; | |
System.out.printf("Input size: %d - Compressed size: %d - Compression ratio: %5.2f%%%n", | |
inputSize, | |
compressedStream.size(), | |
(inputSize-compressedStream.size())*100.0/inputSize); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment