FileIO.fromPath

Emit the contents of a file.

File IO Sinks and Sources

Signature

def fromPath(f: Path, chunkSize: Int = 8192): Source[ByteString, Future[IOResult]]
def fromPath(f: Path, chunkSize: Int, startPosition: Long): Source[ByteString, Future[IOResult]]

Description

Emit the contents of a file, as ByteStrings, materializes into a Future CompletionStage which will be completed with a IOResult upon reaching the end of the file or if there is a failure.

Found an error in this documentation? The source code for this page can be found here. Please feel free to edit and contribute a pull request.