diff options
Diffstat (limited to 'main/api/src/mill/api/IO.scala')
-rw-r--r-- | main/api/src/mill/api/IO.scala | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/main/api/src/mill/api/IO.scala b/main/api/src/mill/api/IO.scala index 8fa5003d..135a26b0 100644 --- a/main/api/src/mill/api/IO.scala +++ b/main/api/src/mill/api/IO.scala @@ -6,22 +6,7 @@ import java.io.{InputStream, OutputStream} * Misc IO utilities, eventually probably should be pushed upstream into * ammonite-ops */ -object IO { - - /** - * 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 - } - }) () - } +object IO extends StreamSupport { /** * Unpacks the given `src` path into the context specific destination directory. @@ -52,19 +37,3 @@ object IO { PathRef(ctx.dest / dest) } } - -import java.io.ByteArrayInputStream - -/** - * A dummy input stream containing an empty byte array. - */ -object DummyInputStream extends ByteArrayInputStream(Array()) - -/** - * A dummy output stream that does nothing with what it consumes (think of it as `/dev/null`). - */ -object DummyOutputStream extends java.io.OutputStream { - override def write(b: Int): Unit = () - override def write(b: Array[Byte]): Unit = () - override def write(b: Array[Byte], off: Int, len: Int): Unit = () -} |