Skip to content
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

Use function from geny to pump streams #3991

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions main/api/src/mill/api/StreamSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,7 @@ trait StreamSupport {
* Pump the data from the `src` stream into the `dest` stream.
*/
def stream(src: InputStream, dest: OutputStream): Unit = {
val buffer = new Array[Byte](4096)
while ({
src.read(buffer) match {
case -1 => false
case n =>
dest.write(buffer, 0, n)
true
}
}) ()
geny.Internal.transfer(src, dest)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

geny.Internal.transfer calls .close on src. Not sure if we actually want to do that given where this function is used?

}

}
Expand Down
Loading