wrapped stream.flush() with try/catch

This commit is contained in:
Robinson 2022-01-19 09:39:51 +01:00
parent 6ac76b6af3
commit 29c81785de
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 3 additions and 3 deletions

View File

@ -455,7 +455,7 @@ class DeferredProcessResult internal constructor(private val process: Process,
val outputStream = process.outputStream
outputStream.write(command.toByteArray(UTF_8))
outputStream.write(EOL)
outputStream.flush()
try { outputStream.flush() } catch (ignored: Exception) {}
}
/**
@ -470,14 +470,14 @@ class DeferredProcessResult internal constructor(private val process: Process,
*/
fun write(bytes: ByteArray) {
process.outputStream.write(bytes)
process.outputStream.flush()
flush()
}
/**
* Flushes the output stream to the process.
*/
fun flush() {
process.outputStream.flush()
try { process.outputStream.flush() } catch (ignored: Exception) {}
}
/**