From 40b9c30d64ee1b07ade423533e627a7d4b099261 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 27 Apr 2017 12:17:20 +0100 Subject: [PATCH] HADOOP-14346. CryptoOutputStream throws IOException if stream is closed. Contributed by Pierre Lacave --- .../java/org/apache/hadoop/crypto/CryptoOutputStream.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CryptoOutputStream.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CryptoOutputStream.java index 1753019cad2..fff0945f8e9 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CryptoOutputStream.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CryptoOutputStream.java @@ -234,7 +234,9 @@ public class CryptoOutputStream extends FilterOutputStream implements */ @Override public synchronized void flush() throws IOException { - checkStream(); + if (closed) { + return; + } encrypt(); super.flush(); }