ByteArrayInputStream stream = new ByteArrayInputStream(buf.toString().getBytes());
OutputStreamWriter writer = new OutputStreamWriter(getConfiguration(), testDefaultPath, Codecs.GZIP.getCodecInfo());
doWithInputStream(stream, writer);
TextFileReader reader = new TextFileReader(getConfiguration(), testDefaultPath, Codecs.GZIP.getCodecInfo());
List<String> data = TestUtils.readData(reader);
assertThat(data.size(), is(1000));
}