From c04bfa1c0ee5a51ef5f63ade8e63d1f55f53fa3e Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Tue, 22 May 2018 21:46:45 -0700 Subject: Migrate `ProxyOutputStream` to the `main.client` module, add unit/fuzz tests to make sure it works --- main/src/mill/main/MillServerMain.scala | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'main/src') diff --git a/main/src/mill/main/MillServerMain.scala b/main/src/mill/main/MillServerMain.scala index 24e49fbe..2fea4bd8 100644 --- a/main/src/mill/main/MillServerMain.scala +++ b/main/src/mill/main/MillServerMain.scala @@ -224,27 +224,4 @@ object Server{ } } -class ProxyOutputStream(out: java.io.OutputStream, - key: Int) extends java.io.OutputStream { - override def write(b: Int) = out.synchronized{ - out.write(key) - out.write(b) - } - - override def write(b: Array[Byte]): Unit = out.synchronized{ - write(b, 0, b.length) - } - - override def write(b: Array[Byte], off: Int, len: Int): Unit = out.synchronized{ - var i = off - while(i < len){ - val chunkLength = math.min(len - i, 127) - out.write(chunkLength * key) - out.write(b, i, chunkLength) - i += chunkLength - } - } - override def flush() = out.flush() - override def close() = out.close() -} -- cgit v1.2.3