@Test public void autoGUnzippedStreamForGZippedFileShouldBeReadableInClear() throws IOException { InputStream gzippedStream = streamFor("/sample_text.txt.gz"); assertThat(toUtf8String(gzippedStream), is(not(HELLO_WORLD))); InputStream in = InputStreams.autoGUnzip(streamFor("/sample_text.txt.gz")); assertThat(toUtf8String(in), is(HELLO_WORLD)); }
@Test public void autoGUnzippedNonMarkableStreamShouldBeReadableInClear() throws IOException { InputStream nonMarkableStream = new NonMarkableByteArrayInputStream(HELLO_WORLD.getBytes(UTF_8)); assertThat(toUtf8String(InputStreams.autoGUnzip(nonMarkableStream)), is(HELLO_WORLD)); }