List of utility methods to do Stream Close
void | closeStream(OutputStream os) Closes an output stream try { os.close(); } catch (Exception e) { |
void | closeStreamIgnoreExpection(InputStream stream) close Stream Ignore Expection try { if (stream != null) { stream.close(); } catch (Exception e) { |
void | closeStreamQuietly(final Closeable closeable) Close quietly an object which implements the Closeable interface such as InputStream, OutputStream, Reader ... try { if (closeable != null) closeable.close(); } catch (IOException ioe) { |
void | closeStreams(FileInputStream fis, FileOutputStream fos) close Streams try { if (fis != null) { fis.close(); } finally { if (fos != null) { fos.close(); |
void | closeStreams(InputStream iStream, OutputStream oStream) close Streams if (iStream != null) { try { iStream.close(); } catch (IOException e) { e.printStackTrace(); if (oStream != null) { ... |
void | closeStreams(InputStream src, OutputStream dest) Closes the streams and reports Exceptions to System.err try { src.close(); } catch (IOException e) { e.printStackTrace(); try { dest.close(); } catch (IOException e) { ... |
void | closeStreams(Process process) close Streams try { process.getInputStream().close(); process.getOutputStream().close(); process.getErrorStream().close(); } catch (IOException e) { e.printStackTrace(); |
InputStream | closeUnchecked(InputStream stream) close Unchecked try { stream.close(); return stream; } catch (IOException e) { throw new RuntimeException(e); |
boolean | closeWarnOnError(Closeable stream, Logger log, String message) close Warn On Error if (stream != null) { try { stream.close(); } catch (IOException e) { if (message == null) message = "Error while attempting to close"; log.log(Level.WARNING, message + ": ", e); return false; ... |
void | closeWhileHandlingException(Closeable... objects) Closes all given Closeables, suppressing all thrown exceptions. closeWhileHandlingException(Arrays.asList(objects)); |