Browse Source

Add @WillClose annotations.

pull/50/head
Chris Smith 9 years ago
parent
commit
090894f468

+ 4
- 2
src/com/dmdirc/util/io/StreamIgnorer.java View File

@@ -27,6 +27,8 @@ import java.io.IOException;
27 27
 import java.io.InputStream;
28 28
 import java.io.InputStreamReader;
29 29
 
30
+import javax.annotation.WillClose;
31
+
30 32
 /**
31 33
  * Stream reader to read, but ignore a stream.
32 34
  */
@@ -38,9 +40,9 @@ class StreamIgnorer extends Thread {
38 40
     /**
39 41
      * Create a new Stream Ignorer that discards output.
40 42
      *
41
-     * @param stream The stream to ignore
43
+     * @param stream The stream to ignore, closed once {@link #run} is called.
42 44
      */
43
-    StreamIgnorer(final InputStream stream) {
45
+    StreamIgnorer(@WillClose final InputStream stream) {
44 46
         super("StreamIgnorer");
45 47
 
46 48
         this.stream = stream;

+ 3
- 1
src/com/dmdirc/util/io/StreamUtils.java View File

@@ -26,6 +26,8 @@ import java.io.Closeable;
26 26
 import java.io.IOException;
27 27
 import java.io.InputStream;
28 28
 
29
+import javax.annotation.WillClose;
30
+
29 31
 /**
30 32
  * Utilities for dealing with streams.
31 33
  *
@@ -37,7 +39,7 @@ public final class StreamUtils {
37 39
     private StreamUtils() {
38 40
     }
39 41
 
40
-    public static void readStream(final InputStream inputStream) {
42
+    public static void readStream(@WillClose final InputStream inputStream) {
41 43
         new StreamIgnorer(inputStream).run();
42 44
     }
43 45
 

Loading…
Cancel
Save