From 59fc6ee1fceb3191ed7b4d06b993bbbb58511954 Mon Sep 17 00:00:00 2001 From: Michael Allison Date: Sun, 22 Sep 2024 17:08:59 -0700 Subject: [PATCH] Fix "zero sized output" bug --- .../kotlin/ io/github/thibseisel/identikon/IdenticonJvm.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/jvmMain/kotlin/ io/github/thibseisel/identikon/IdenticonJvm.kt b/lib/src/jvmMain/kotlin/ io/github/thibseisel/identikon/IdenticonJvm.kt index 9f010ba..39b6752 100644 --- a/lib/src/jvmMain/kotlin/ io/github/thibseisel/identikon/IdenticonJvm.kt +++ b/lib/src/jvmMain/kotlin/ io/github/thibseisel/identikon/IdenticonJvm.kt @@ -29,5 +29,7 @@ import java.io.OutputStream public fun Identicon.saveAsSvg(stream: OutputStream) { val renderer = SvgRenderer(size, size) render(renderer) - renderer.save(stream.bufferedWriter()) + val br = stream.bufferedWriter() + renderer.save(br) + br.close() }