Skip to content

Commit 95e9c3b

Browse files
committed
Make PrintToStringConsumerStream implementation more concise
1 parent 240f83b commit 95e9c3b

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/main/kotlin/org/scijava/scripting/fx/PrintToStringConsumerStream.kt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@ import java.io.OutputStream
77
class PrintToStringConsumerStream(private val target: (String) -> Unit) : OutputStream() {
88

99
@Throws(IOException::class)
10-
override fun write(var1: Int) {
11-
NotImplementedError("Not supported!")
12-
}
10+
override fun write(var1: Int) = throw NotImplementedError("Not supported!")
1311

1412
@Throws(IOException::class)
15-
override fun write(data: ByteArray) {
16-
this.write(data, 0, data.size)
17-
}
13+
override fun write(data: ByteArray) = this.write(data, 0, data.size)
1814

1915
@Throws(IOException::class)
2016
override fun write(data: ByteArray?, start: Int, size: Int) {
@@ -28,12 +24,10 @@ class PrintToStringConsumerStream(private val target: (String) -> Unit) : Output
2824
}
2925

3026
@Throws(IOException::class)
31-
override fun flush() {
32-
}
27+
override fun flush() = Unit
3328

3429
@Throws(IOException::class)
35-
override fun close() {
36-
}
30+
override fun close() = Unit
3731

3832

3933
}

0 commit comments

Comments
 (0)