public final class MultiInputCloseableIterator<T,CI extends Iterator<T> & Closeable> extends AbstractIterator<T> implements Closeable
InputStream
sources.Constructor and Description |
---|
MultiInputCloseableIterator(Iterable<Supplier<InputStream>> inputs,
Function<InputStream,CI> iterateInputStream)
Construct.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected T |
computeNext() |
static Function<InputStream,CloseableLineIterator> |
iterateLines()
Iterate lines of an
InputStream . |
static Function<InputStream,StructureRecordIterator> |
iterateStructureRecords(String opts)
Create
StructureRecordIterator form an InputStream . |
endOfData, hasNext, next, peek
remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public MultiInputCloseableIterator(Iterable<Supplier<InputStream>> inputs, Function<InputStream,CI> iterateInputStream)
InputStream
s is done only on the first read after closing the previous ones.inputs
- Inputs.iterateInputStream
- Factory for create a Closeable
Iterator
for an InputStream
public static Function<InputStream,CloseableLineIterator> iterateLines()
InputStream
.public static Function<InputStream,StructureRecordIterator> iterateStructureRecords(String opts)
StructureRecordIterator
form an InputStream
.opts
- Options to pass to the underlying MFileFormatUtil#createRecordReader(java.io.InputStream, java.lang.String)
protected T computeNext()
computeNext
in class AbstractIterator<T>
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException