Code:
val document = findDocumentByUUID(searchParams(customerNumber), documentUUID)
val documentContentStreamURI =
document?.documentContentStream ?: throw NoDocumentFoundException("Couldn't find document with id $id")
val content = digipostClient
.getArchiveDocumentContentStream(documentContentStreamURI)
.use { it.readBytes() }
When doing it.readBytes(), following exception is thrown:
java.io.IOException: Attempted read on closed stream.
Which hints that the stream returned by getArchiveDocumentContentStream(...) is already closed for some reason.
This appears in version 17 of the client, works fine in 16.