From fdcc3512f7b45e5b067fc26cb05146f79c4a5177 Mon Sep 17 00:00:00 2001 From: tedyu Date: Mon, 25 Jan 2016 18:23:47 -0800 Subject: [SPARK-12934] use try-with-resources for streams liancheng please take a look Author: tedyu Closes #10906 from tedyu/master. --- .../src/main/java/org/apache/spark/util/sketch/CountMinSketch.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java b/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java index 67938644d9..9f4ff42403 100644 --- a/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java +++ b/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java @@ -128,11 +128,13 @@ abstract public class CountMinSketch { /** * Writes out this {@link CountMinSketch} to an output stream in binary format. + * It is the caller's responsibility to close the stream */ public abstract void writeTo(OutputStream out) throws IOException; /** * Reads in a {@link CountMinSketch} from an input stream. + * It is the caller's responsibility to close the stream */ public static CountMinSketch readFrom(InputStream in) throws IOException { return CountMinSketchImpl.readFrom(in); -- cgit v1.2.3