public class StructureRecordIterator extends CloseableAbstractIterator<StructureRecord>
Closes underlying reader upon explicit close.
Constructor and Description |
---|
StructureRecordIterator(InputStream is,
String opts)
New instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected StructureRecord |
computeNext() |
String |
getFormat()
Get format.
|
endOfData, hasNext, next, peek
remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
transform
forEachRemaining, hasNext, next, remove
public StructureRecordIterator(InputStream is, String opts)
Note that empty stream can not be wrapped. Otherwise getFormat()
would need to be ambiguous in case of
empty stream.
is
- InputStream to read from. Note that the passed stream is read but not closed when end reached. Method
close()
closes the underlying MRecordReader
. Note that if the stream is empty
IllegalArgumentException
thrown.opts
- Options to pass to underlying
MFileFormatUtil.createRecordReader(java.io.InputStream, java.lang.String)
IllegalArgumentException
- when opening was problematic due to exception from the underlying
MRecordReader
.protected StructureRecord computeNext()
computeNext
in class AbstractIterator<StructureRecord>
public void close()
public String getFormat()
MRecordReader.getRecognizedFormat()