Package net.sansa_stack.rdf.benchmark.io
Class ReadableByteChannelFromIterator
- java.lang.Object
-
- net.sansa_stack.rdf.benchmark.io.ReadableByteChannelFromIterator
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,ReadableByteChannel
public class ReadableByteChannelFromIterator extends Object implements ReadableByteChannel
-
-
Field Summary
Fields Modifier and Type Field Description protected ByteBuffer
currentBuffer
protected boolean
isOpen
protected Iterator<ByteBuffer>
it
-
Constructor Summary
Constructors Constructor Description ReadableByteChannelFromIterator(Iterator<ByteBuffer> it)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
isOpen()
static void
main(String[] args)
int
read(ByteBuffer dst)
static InputStream
toInputStream(Iterator<String> it)
static InputStream
toInputStream(Stream<String> stream)
-
-
-
Field Detail
-
it
protected Iterator<ByteBuffer> it
-
isOpen
protected boolean isOpen
-
currentBuffer
protected ByteBuffer currentBuffer
-
-
Constructor Detail
-
ReadableByteChannelFromIterator
public ReadableByteChannelFromIterator(Iterator<ByteBuffer> it)
-
-
Method Detail
-
main
public static void main(String[] args)
-
toInputStream
public static InputStream toInputStream(Iterator<String> it)
-
toInputStream
public static InputStream toInputStream(Stream<String> stream)
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
read
public int read(ByteBuffer dst)
- Specified by:
read
in interfaceReadableByteChannel
-
-