Search in sources :

Example 11 with InputStreamFileInput

use of org.embulk.spi.util.InputStreamFileInput in project embulk by embulk.

the class TestInputStreamFileInput method testSingleProvider.

@Test
public void testSingleProvider() throws IOException {
    InputStreamFileInput subject = new InputStreamFileInput(runtime.getBufferAllocator(), provider(new ByteArrayInputStream("abcdef".getBytes("UTF-8"))));
    assertEquals(true, subject.nextFile());
    assertEquals("abcdef", bufferToString(subject.poll()));
    assertEquals(null, subject.poll());
    subject.close();
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStreamFileInput(org.embulk.spi.util.InputStreamFileInput) Test(org.junit.Test)

Aggregations

InputStreamFileInput (org.embulk.spi.util.InputStreamFileInput)11 ByteArrayInputStream (java.io.ByteArrayInputStream)9 Test (org.junit.Test)8 InputStream (java.io.InputStream)6 IOException (java.io.IOException)5 FileInputInputStream (org.embulk.spi.util.FileInputInputStream)2 GZIPInputStream (java.util.zip.GZIPInputStream)1 BZip2CompressorInputStream (org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream)1 ValueFactory.newString (org.msgpack.value.ValueFactory.newString)1