From 71def3e59c7e913eb34ddd46a4338ff1108f39f6 Mon Sep 17 00:00:00 2001 From: Lorenzo Gabriele Date: Tue, 19 Nov 2024 15:46:10 +0100 Subject: [PATCH] Use function from geny to pump streams --- main/api/src/mill/api/StreamSupport.scala | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/main/api/src/mill/api/StreamSupport.scala b/main/api/src/mill/api/StreamSupport.scala index 0674794ba15..f29fa6a2b5c 100644 --- a/main/api/src/mill/api/StreamSupport.scala +++ b/main/api/src/mill/api/StreamSupport.scala @@ -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) } }