Interface FromFileReader<T>
- All Superinterfaces:
AutoCloseable, Closeable, Iterable<T>
- All Known Implementing Classes:
DataReader, ManagedReader, MappedReader, QueuedReader, SequencedReader, TextLineReader
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()static voidcopy(File sourceFile, Properties destinationMap) Read the properties file and copy the entries to the supplied destinationPropertiesinstance.static voidDelete this file or directory (does not need to be empty).static <T extends Serializable>
Tdefault intdrainTo(Collection<? super T> container, int maxElements) Behaves similar toBlockingQueue.drainTo(Collection, int)except that returning 0 means there are no more items to read.static <T> FromFileReader<T> empty()default voidforEachInBacthes(int batchSize, Consumer<? super T> action) Similar toIterable.forEach(Consumer)but processes items in batches.static InputStreamstatic InputStreaminput(File file, OperatorWithException<InputStream> filter) iterator()default <U> FromFileReader<U> static <F> FromFileReader.Builder<F> newBuilder(F... file) static FromFileReader.Builder<File> newBuilder(File file) static FromFileReader.Builder<Path> newBuilder(Path file) newBuilder(SegmentedFile segmented) static FromFileReader.Builder<File> newBuilder(ShardedFile sharded) read()Returning null indicates that there are no more items to read.stream()Methods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
copy
Read the properties file and copy the entries to the supplied destinationPropertiesinstance.- Parameters:
sourceFile- Source properties filedestinationMap- Destination properties map
-
delete
Delete this file or directory (does not need to be empty).- Parameters:
file- Path to a file or directory to be deleted
-
deserializeObjectFromFile
-
empty
-
input
-
input
-
newBuilder
-
newBuilder
-
newBuilder
-
newBuilder
-
newBuilder
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
drainTo
Behaves similar toBlockingQueue.drainTo(Collection, int)except that returning 0 means there are no more items to read. -
forEachInBacthes
Similar toIterable.forEach(Consumer)but processes items in batches. Will extract up to batchSize items before calling the action, and then repeat until no more items are available. -
iterator
-
map
-
read
T read()Returning null indicates that there are no more items to read. That's the same behaviour asBufferedReader.readLine(). All implementations must return null precisely once. -
stream
-