use of org.teiid.client.lob.LobChunkProducer in project teiid by teiid.
the class TestLobChunkInputStream method testReadByteArray.
public void testReadByteArray() throws Exception {
LobChunkProducer chunkProducer = new LobChunkProducer() {
// $NON-NLS-1$ //$NON-NLS-2$
Iterator<LobChunk> chuncks = Arrays.asList(new LobChunk("hello ".getBytes(), false), new LobChunk("world".getBytes(), true)).iterator();
@Override
public LobChunk getNextChunk() throws IOException {
return chuncks.next();
}
@Override
public void close() throws IOException {
}
};
LobChunkInputStream stream = new LobChunkInputStream(chunkProducer);
// $NON-NLS-1$
assertEquals("hello world", ObjectConverterUtil.convertToString(stream));
}
Aggregations