[Pixelle-commit] SF.net SVN: pixelle:[180] trunk/pixelle/src/com/mebigfatguy/pixelle/utils/ Closer.
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-11-14 16:42:27
|
Revision: 180
http://pixelle.svn.sourceforge.net/pixelle/?rev=180&view=rev
Author: dbrosius
Date: 2008-11-14 16:42:24 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
simplify by using Closeable
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java 2008-11-14 16:40:19 UTC (rev 179)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java 2008-11-14 16:42:24 UTC (rev 180)
@@ -18,50 +18,19 @@
*/
package com.mebigfatguy.pixelle.utils;
+import java.io.Closeable;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.Writer;
-public class Closer {
+public final class Closer {
private Closer() {
}
- public static void close(InputStream is) {
+ public static void close(Closeable c) {
try {
- if (is != null) {
- is.close();
+ if (c != null) {
+ c.close();
}
} catch (IOException ioe) {
}
}
-
- public static void close(OutputStream os) {
- try {
- if (os != null) {
- os.close();
- }
- } catch (IOException ioe) {
- }
- }
-
- public static void close(Reader r) {
- try {
- if (r != null) {
- r.close();
- }
- } catch (IOException ioe) {
- }
- }
-
- public static void close(Writer w) {
- try {
- if (w != null) {
- w.close();
- }
- } catch (IOException ioe) {
- }
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|