List of utility methods to do Stream Close
void | closeReader(BufferedReader reader) close Reader if (Objects.isNull(reader)) { return; try { reader.close(); } catch (IOException e) { e.printStackTrace(); |
void | closeReader(final Reader reader) Closes the given reader and swallows exceptions that may arise during the process. try { reader.close(); } catch (IOException e) { System.err.println("Error closing " + reader + ": " + e); |
void | closeReader(Reader r) close Reader if (r != null) try { r.close(); } catch (Exception e) { |
void | closeReader(Reader reader) Close the given Java IO Reader and ignore any thrown exception. if (reader != null) { try { reader.close(); } catch (IOException ex) { ex.printStackTrace(); } catch (Throwable ex) { ex.printStackTrace(); |
void | closeReader(Reader reader) Closes the reader try { reader.close(); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException("Unable to close the reader " + e.getMessage()); |
void | closeReader(Reader rReader) Closes a reader. try { if (rReader != null) { rReader.close(); } catch (IOException ignored) { |
void | closeRelaxed(Closeable resource) Close the given resource relaxed. if (resource != null) { try { resource.close(); } catch (IOException ignore) { |
void | closeReportFile() close Report File if (wor) { return; File orepfile = new File(oreppath); try (PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(orepfile, true)))) { pw.println("</REPORT>"); |
boolean | closeResource(final Closeable aResource) Closes a given resource. boolean result = false; if (aResource != null) { try { if (aResource instanceof Flushable) { ((Flushable) aResource).flush(); } catch (IOException exception) { } finally { ... |
void | closeSafe(InputStream inputStream) close Safe if (inputStream != null) {
inputStream.close();
|