List of utility methods to do Stream Close
void | closeSilently(OutputStream outputStream) Closes the OutputStream , ignoring any exceptions raised while closing.
flushSilently(outputStream); try { outputStream.close(); } catch (IOException ignored) { |
void | closeStatusFile(PrintWriter pwStatusFile) This will close the status file. if (pwStatusFile != null) {
pwStatusFile.close();
pwStatusFile = null;
|
void | closeStream(Closeable aStream) Silently closes the given stream. try { aStream.close(); } catch (Exception ex) { |
void | closeStream(Closeable closeable) check null and Close a stream if (closeable != null) {
closeable.close();
|
void | closeStream(Closeable closeable) Convenience method for closing streams that swallows the IOException that could be thrown during closing.
if (closeable != null) { try { closeable.close(); } catch (IOException e) { |
void | closeStream(Closeable stream) Close IO stream safely. try { if (stream != null) { stream.close(); } catch (IOException e) { System.out.println("Close IO stream failure."); e.printStackTrace(); |
void | closeStream(Closeable stream) close Stream try { stream.close(); } catch (IOException e) { throw new IllegalArgumentException(stream + " can not close", e); |
void | closeStream(Closeable... closeable) close Stream for (Closeable c : closeable) { if (c != null) { try { c.close(); } catch (IOException ignored) { |
void | closeStream(Closeable... streams) close Stream if (streams == null) return; for (Closeable stream : streams) { CloseOneStream(stream); |
void | closeStream(FileInputStream in) close Stream if (in != null) { try { in.close(); } catch (IOException e) { e.printStackTrace(); |