public class LineStream extends AbstractObjectStream<java.lang.String>
Stream that reads lines from a file.
stream| Constructor and Description |
|---|
LineStream(java.io.BufferedReader in)
Construct a stream reading lines from a buffered reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
No-op implementation of the
ObjectStream.close() method. |
int |
getLineNumber()
Return the number of the line returned by the last call to
readObject(). |
static LineStream |
openFile(java.io.File file)
Open a delimited text stream as a file.
|
static LineStream |
openFile(java.io.File file,
CompressionMode comp)
Open a delimited text stream as a file.
|
java.lang.String |
readObject()
Read the next object from this stream.
|
ObjectStream<java.util.List<java.lang.String>> |
tokenize(org.apache.commons.lang3.text.StrTokenizer tok) |
allMatch, anyMatch, collect, collect, count, distinct, filter, findAny, findFirst, flatMap, flatMapToDouble, flatMapToInt, flatMapToLong, forEach, forEachOrdered, isParallel, iterator, limit, map, mapToDouble, mapToInt, mapToLong, max, min, noneMatch, onClose, parallel, peek, reduce, reduce, reduce, sequential, skip, sorted, sorted, spliterator, toArray, toArray, unorderedpublic LineStream(@WillCloseWhenClosed @Nonnull
java.io.BufferedReader in)
Construct a stream reading lines from a buffered reader.
in - The input reader.public static LineStream openFile(java.io.File file) throws java.io.FileNotFoundException
Open a delimited text stream as a file.
file - The file to open.java.io.FileNotFoundException - if there is an error opening the file.public static LineStream openFile(java.io.File file, CompressionMode comp) throws java.io.IOException
Open a delimited text stream as a file.
file - The file to open.java.io.FileNotFoundException - if there is an error opening the file.java.io.IOException@Nullable public java.lang.String readObject()
ObjectStreamRead the next object from this stream.
null if at the end of the stream.public int getLineNumber()
Return the number of the line returned by the last call to readObject().
public void close()
AbstractObjectStreamNo-op implementation of the ObjectStream.close() method.
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.util.stream.BaseStream<java.lang.String,java.util.stream.Stream<java.lang.String>>close in interface ObjectStream<java.lang.String>close in class AbstractObjectStream<java.lang.String>public ObjectStream<java.util.List<java.lang.String>> tokenize(org.apache.commons.lang3.text.StrTokenizer tok)