-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File I/O #139
Conversation
Thanks :) |
*/ | ||
def fromFile(path: Path, chunkSize: Int = 1024)(using Ox): Source[Chunk[Byte]] = | ||
if Files.isDirectory(path) then throw new IOException(s"Path $path is a directory") | ||
val chunks = StageCapacity.newChannel[Chunk[Byte]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw @kciesielski here we could have an implicit StageCapacity
as well
chunks.done() | ||
false | ||
else if readBytes == 0 then | ||
chunks.send(Chunk.empty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and re-reading this, is there any point in sending empty chunks? ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, no point :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #137