/*
 *  Copyright (c) 2014 RONDHUIT Co.,Ltd.
 *
 */

package com.rondhuit.commons;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;

/**
 * 
 * @since 0.1
 */
public final class IOUtils {

  public static void closeQuietly(InputStream is){
    try{
      is.close();
    }
    catch(IOException ignored){}
  }

  public static void closeQuietly(Reader r){
    try{
      r.close();
    }
    catch(IOException ignored){}
  }

  public static void closeQuietly(OutputStream os){
    try{
      os.close();
    }
    catch(IOException ignored){}
  }

  public static void closeQuietly(Writer w){
    try{
      w.close();
    }
    catch(IOException ignored){}
  }
}

@@ -329,16 +329,31 @@
 y%7B%0A     
+ if(is != null)
  is.clos
@@ -349,32 +349,32 @@
 ll) is.close();%0A
-
     %7D%0A    catch(
@@ -460,16 +460,30 @@
 y%7B%0A     
+ if(r != null)
  r.close
@@ -596,16 +596,31 @@
 y%7B%0A     
+ if(os != null)
  os.clos
@@ -722,21 +722,35 @@
    try%7B%0A
-
      
+ if(w != null)
  w.close

fix NPE bugs of IOUtils