com.tomgibara.pronto.util
Class CharStreams

java.lang.Object
  extended by com.tomgibara.pronto.util.CharStreams

public final class CharStreams
extends java.lang.Object

A collection of static methods for handling readers and writers.

Author:
Tom Gibara

Method Summary
static void safeClose(java.io.Reader reader)
          Attempts to close the supplied reader.
static void safeClose(java.io.Writer writer)
          Attempts to close the supplied writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

safeClose

public static void safeClose(java.io.Reader reader)
Attempts to close the supplied reader. If a null reader is supplied, no action is taken. If an IOException occurs while closing the reader, the exception is silently ignored.

Parameters:
reader - a Reader instance or null

safeClose

public static void safeClose(java.io.Writer writer)
Attempts to close the supplied writer. If a null writer is supplied, no action is taken. If an IOException occurs while closing the writer, the exception is silently ignored.

Parameters:
writer - a Writer instance or null


Copyright © 2006-2007 Tom Gibara. All Rights Reserved.