Skip to content

[17.0.x] getArchiveDocumentContentStream returns closed stream #209

@kiangol

Description

@kiangol

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions