[Pixelle-commit] SF.net SVN: pixelle: [145] trunk/pixelle/src/com/mebigfatguy/pixelle/utils/ Closer
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-07-06 21:17:18
|
Revision: 145
http://pixelle.svn.sourceforge.net/pixelle/?rev=145&view=rev
Author: dbrosius
Date: 2008-07-06 14:17:18 -0700 (Sun, 06 Jul 2008)
Log Message:
-----------
utility to swallow exceptions on close
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java 2008-07-06 21:17:18 UTC (rev 145)
@@ -0,0 +1,67 @@
+/*
+ * pixelle - Graphics algorithmic editor
+ * Copyright (C) 2008 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package com.mebigfatguy.pixelle.utils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+
+public class Closer {
+ private Closer() {
+ }
+
+ public void close(InputStream is) {
+ try {
+ if (is != null) {
+ is.close();
+ }
+ } catch (IOException ioe) {
+ }
+ }
+
+ public void close(OutputStream os) {
+ try {
+ if (os != null) {
+ os.close();
+ }
+ } catch (IOException ioe) {
+ }
+ }
+
+ public void close(Reader r) {
+ try {
+ if (r != null) {
+ r.close();
+ }
+ } catch (IOException ioe) {
+ }
+ }
+
+ public void close(Writer w) {
+ try {
+ if (w != null) {
+ w.close();
+ }
+ } catch (IOException ioe) {
+ }
+ }
+
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/utils/Closer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|