We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40206b8 commit 3041aedCopy full SHA for 3041aed
bridge/src/test/scala/protocbridge/frontend/PosixPluginFrontendSpec.scala
@@ -1,5 +1,6 @@
1
package protocbridge.frontend
2
3
+import org.apache.commons.io.IOUtils
4
import org.scalatest.flatspec.AnyFlatSpec
5
import org.scalatest.matchers.must.Matchers
6
import protocbridge.{ExtraEnv, ProtocCodeGenerator}
@@ -33,14 +34,7 @@ class PosixPluginFrontendSpec extends AnyFlatSpec with Matchers {
33
34
writeInput.write(toSend)
35
writeInput.close()
36
}, processOutput => {
- val buffer = new Array[Byte](4096)
37
- var bytesRead = 0
38
- while (bytesRead != -1) {
39
- bytesRead = processOutput.read(buffer)
40
- if (bytesRead != -1) {
41
- actualOutput.write(buffer, 0, bytesRead)
42
- }
43
+ IOUtils.copy(processOutput, actualOutput)
44
processOutput.close()
45
}, _.close()))
46
process.exitValue()
0 commit comments