Skip to content

Commit 8bb7181

Browse files
author
Niall Pemberton
committed
IO-224 Remove IOUtils.closeQuietly(Channel) added as part of IO-155 - redundant now there is IOUtils.closeQuietly(Closeable)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1003652 13f79535-47bb-0310-9956-ffa450edef68
1 parent 724d798 commit 8bb7181

1 file changed

Lines changed: 0 additions & 29 deletions

File tree

src/java/org/apache/commons/io/IOUtils.java

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -171,35 +171,6 @@ public static void closeQuietly(Reader input) {
171171
closeQuietly((Closeable)input);
172172
}
173173

174-
/**
175-
* Unconditionally close a <code>Channel</code>.
176-
* <p>
177-
* Equivalent to {@link Channel#close()}, except any exceptions will be ignored.
178-
* This is typically used in finally blocks.
179-
* <p>
180-
* Example code:
181-
* <pre>
182-
* ByteBuffer buffer = ByteBuffer.allocate(1024);
183-
* FileChannel channel = null;
184-
* try {
185-
* FileInputStream in = new FileInputStream("foo.txt");
186-
* channel = in.getChannel();
187-
* channel.read(buffer);
188-
* channel.close(); //close errors are handled
189-
* } catch (Exception e) {
190-
* // error handling
191-
* } finally {
192-
* IOUtils.closeQuietly(channel);
193-
* }
194-
* </pre>
195-
*
196-
* @param channel the Channel to close, may be null or already closed
197-
* @since Commons IO 2.0
198-
*/
199-
public static void closeQuietly(Channel channel) {
200-
closeQuietly((Closeable)channel);
201-
}
202-
203174
/**
204175
* Unconditionally close a <code>Writer</code>.
205176
* <p>

0 commit comments

Comments
 (0)