diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/att/dmf/mr/utils/DMaaPResponseBuilder.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/att/dmf/mr/utils/DMaaPResponseBuilder.java b/src/main/java/com/att/dmf/mr/utils/DMaaPResponseBuilder.java index 4c38d57..c9a998b 100644 --- a/src/main/java/com/att/dmf/mr/utils/DMaaPResponseBuilder.java +++ b/src/main/java/com/att/dmf/mr/utils/DMaaPResponseBuilder.java @@ -130,10 +130,10 @@ public class DMaaPResponseBuilder { */ public static void respondOkWithStream(DMaaPContext ctx, String mediaType, StreamWriter writer) throws IOException { ctx.getResponse().setStatus(200); - OutputStream os = getStreamForBinaryResponse(ctx, mediaType); - writer.write(os); - os.close(); - + try(OutputStream os = getStreamForBinaryResponse(ctx, mediaType)) { + writer.write(os); + } + } |