List of utility methods to do Stream Close
void | closeWithoutError(Object close) close the Closeable object, without any exception. try { if (close == null) { return; if (close instanceof Closeable) { ((Closeable) close).close(); } catch (Exception e) { ... |
void | closeWithRuntimeException(Closeable c) close With Runtime Exception try { c.close(); } catch (IOException e) { throw new RuntimeException(e); |
boolean | closeWriteFile(FileOutputStream fileoutputstream) close Write File try { fileoutputstream.close(); return true; } catch (IOException ex) { System.err.println("File cannot be closed."); return false; |
void | closeWriter(final Writer writer) If writer not null , close it and ignore IOException if (writer != null) { try { writer.close(); } catch (IOException e) { |
void | closeWriter(PrintWriter pw) closes the given writer if (pw != null) {
pw.close();
|
void | closeWriter(Writer writer) close Writer if (writer != null) { try { writer.close(); } catch (IOException e) { |
void | closexBaseJProperty() use this if you need to reset the property file which is usually left open synchronized (props) { propFile = null; if (propIS != null) { try { propIS.close(); } catch (IOException e) { propIS = null; ... |
void | closeXMLState(int toState) output whatever is required to close the current xml for the current xml state. if (spcOutputWriter != null) { if (toState == STATE_INIT) { if (xmlstate == STATE_CHILD_COMPLETE) { spcOutputWriter.write("</window></application></object>"); spcOutputWriter.newLine(); } else if (xmlstate == STATE_WIN) { spcOutputWriter.write(" /></application></object>"); spcOutputWriter.newLine(); ... |
void | closeZipOutputStreamQuietly(ZipOutputStream zipOutputStream) Close an open ZipOutputStream without errormessages try { zipOutputStream.finish(); zipOutputStream.flush(); zipOutputStream.close(); zipOutputStream = null; } catch (IOException e) { } finally { if (zipOutputStream != null) { ... |
void | closeZipQuietly(@Nullable ZipFile file) ZipFile does not implement Closeable on Java 6. try { if (file != null) { file.close(); } catch (IOException ioe) { |