@@ -8,21 +8,21 @@ import kotlin.jvm.Throws
88internal class ErrorStream (private val outputStream : OutputStream ) : OutputStream() {
99
1010 @Throws(IOException ::class )
11- override fun write (b : Int ) {
11+ override fun write (b : Int ) = synchronized(outputStream) {
1212 outputStream.write(" <errStream>" .toByteArray())
1313 outputStream.write(b)
1414 outputStream.write(" </errStream>" .toByteArray())
1515 }
1616
1717 @Throws(IOException ::class )
18- override fun write (b : ByteArray ) {
18+ override fun write (b : ByteArray ) = synchronized(outputStream) {
1919 outputStream.write(" <errStream>" .toByteArray())
2020 outputStream.write(b)
2121 outputStream.write(" </errStream>" .toByteArray())
2222 }
2323
2424 @Throws(IOException ::class )
25- override fun write (b : ByteArray , offset : Int , length : Int ) {
25+ override fun write (b : ByteArray , offset : Int , length : Int ) = synchronized(outputStream) {
2626 outputStream.write(" <errStream>" .toByteArray())
2727 outputStream.write(b, offset, length)
2828 outputStream.write(" </errStream>" .toByteArray())
@@ -32,21 +32,21 @@ internal class ErrorStream(private val outputStream: OutputStream) : OutputStrea
3232internal class OutStream (private val outputStream : OutputStream ) : OutputStream() {
3333
3434 @Throws(IOException ::class )
35- override fun write (b : Int ) {
35+ override fun write (b : Int ) = synchronized(outputStream) {
3636 outputStream.write(" <outStream>" .toByteArray())
3737 outputStream.write(b)
3838 outputStream.write(" </outStream>" .toByteArray())
3939 }
4040
4141 @Throws(IOException ::class )
42- override fun write (b : ByteArray ) {
42+ override fun write (b : ByteArray ) = synchronized(outputStream) {
4343 outputStream.write(" <outStream>" .toByteArray())
4444 outputStream.write(b)
4545 outputStream.write(" </outStream>" .toByteArray())
4646 }
4747
4848 @Throws(IOException ::class )
49- override fun write (b : ByteArray , offset : Int , length : Int ) {
49+ override fun write (b : ByteArray , offset : Int , length : Int ) = synchronized(outputStream) {
5050 outputStream.write(" <outStream>" .toByteArray())
5151 outputStream.write(b, offset, length)
5252 outputStream.write(" </outStream>" .toByteArray())
0 commit comments