org.jurvis.io
Class JvCloser

java.lang.Object
  extended by org.jurvis.io.JvCloser

public final class JvCloser
extends Object

Utility class containing methods to close InputStreams, Connections, etc. This class exists because the close() methods throw some type of exception which must be caught thereby muddying up the already muddy code. This class just hides the try...catch.

Author:
Neil W. Weber

Method Summary
static void close(InputStream s)
          Close an InputStream.
static void close(OutputStream s)
          Close an OutputStream.
static void close(Reader r)
          Close an Reader.
static void close(ServerSocket s)
          Close a ServerSocket.
static void close(Socket s)
          Close a Socket.
static void close(Writer w)
          Close a Writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

close

public static void close(InputStream s)
Close an InputStream. Logs the exception if there was a failure.

Parameters:
s - the InputStream to close

close

public static void close(OutputStream s)
Close an OutputStream. Logs the exception if there was a failure.

Parameters:
s - the OutputStream to close

close

public static void close(Reader r)
Close an Reader. Logs the exception if there was a failure.

Parameters:
r - the Reader to close

close

public static void close(Writer w)
Close a Writer. Logs the exception if there was a failure.

Parameters:
w - the Writer to close

close

public static void close(Socket s)
Close a Socket. Logs the exception if there was a failure.

Parameters:
s - the Socket to close

close

public static void close(ServerSocket s)
Close a ServerSocket. Logs the exception if there was a failure.

Parameters:
s - the ServerSocket to close


Copyright © 1999-2004 Neil W. Weber. All Rights Reserved.