Skip to content

Cannot close custom OutputStream #35220

@brucelwl

Description

@brucelwl

I use CustomServletServerHttpResponse to inherit ServletServerHttpResponse and customize the compression algorithm for response requests. However, I found that my close method cannot be called due to the following code Unable to clear CustomOutputStream native memory,

OutputStream outputStream = StreamUtils.nonClosing(outputMessage.getBody());
try (JsonGenerator generator = objectMapper.getFactory().createGenerator(outputStream, encoding)) {
writePrefix(generator, object);

I have searched for relevant issues, but I have not found a clear solution to close my own defined OutputStream

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions