List of utility methods to do Stream Close
void | closeStream(final Closeable stream) close Stream stream.close(); |
void | closeStream(final InputStream in) Closes the given stream and swallows exceptions that may arise during the process. try { in.close(); } catch (IOException e) { System.err.println("Error closing " + in + ": " + e); |
boolean | closeStream(final InputStream stream) Closes the InputStream, catching the exception and returning false on failure. if (stream == null) { return false; try { stream.close(); } catch (IOException e) { e.printStackTrace(); return false; ... |
void | closeStream(final java.io.Closeable stream) Closes the stream ignoring IOException . cleanup(null, stream); |
void | closeStream(final Object stream) Close an InputStream or OutputStream. try { if (stream instanceof OutputStream) { OutputStream out = (OutputStream) stream; try { out.flush(); } finally { out.close(); } else if (stream instanceof InputStream) { ((InputStream) stream).close(); } catch (Exception e) { |
void | closeStream(InputStream in) close Stream close(in); |
boolean | closeStream(InputStream in) close Stream try { if (in != null) { in.close(); return true; } catch (IOException ioe) { return false; |
void | closeStream(InputStream inputStream) close Stream try { inputStream.close(); } catch (IOException e) { |
void | closeStream(InputStream ins) close Stream try { ins.close(); } catch (IOException e) { |
void | closeStream(Object oin) close Stream if (oin != null) try { if (oin instanceof InputStream) ((InputStream) oin).close(); if (oin instanceof OutputStream) ((OutputStream) oin).close(); } catch (IOException e) { e.printStackTrace(); ... |