Java Stream Close closeWithRuntimeException(Closeable c)

Here you can find the source of closeWithRuntimeException(Closeable c)

Description

close With Runtime Exception

License

Open Source License

Declaration

public static void closeWithRuntimeException(Closeable c) 

Method Source Code


//package com.java2s;

import java.io.Closeable;
import java.io.IOException;

public class Main {
    public static void closeWithRuntimeException(Closeable c) {
        try {//from  w  ww . j a  v  a 2 s.  co m
            c.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. closeStreams(Process process)
  2. closeUnchecked(InputStream stream)
  3. closeWarnOnError(Closeable stream, Logger log, String message)
  4. closeWhileHandlingException(Closeable... objects)
  5. closeWithoutError(Object close)
  6. closeWriteFile(FileOutputStream fileoutputstream)
  7. closeWriter(final Writer writer)
  8. closeWriter(PrintWriter pw)
  9. closeWriter(Writer writer)