Prevent future write attempts to System.out

This commit is contained in:
Mygod
2020-07-24 03:38:45 +08:00
parent 8a7a20eccb
commit 8908605767

View File

@@ -445,6 +445,7 @@ class RootServer @JvmOverloads constructor(private val warnLogger: (String) -> U
writer.appendln(args[0]) // echo ready signal writer.appendln(args[0]) // echo ready signal
writer.flush() writer.flush()
}) })
System.setOut(System.err) // prevent future write attempts to System.out
// thread safety: usage of input should be in main thread // thread safety: usage of input should be in main thread
val input = DataInputStream(System.`in`.buffered()) val input = DataInputStream(System.`in`.buffered())
var counter = 0L var counter = 0L