List of utility methods to do Stream Close
void | close(FileReader fr) close if (fr != null) { try { fr.close(); } catch (IOException e) { |
void | close(FileReader reader, BufferedReader br) close try { if (reader != null) reader.close(); if (br != null) br.close(); } catch (IOException e) { |
void | close(final Closeable resource, final String resourceId) Close the passed resource and care about possible problems. if (resource != null) { try { resource.close(); } catch (IOException e) { throw new RuntimeException( "Could not close resource properly for unknown reason (unexpected exception): " + resourceId, e); ... |
void | close(final Exception e, final Closeable... objects) Closes all given Closeable s. close(e, Arrays.asList(objects)); |
void | close(final InputStream anInputStream) close try { anInputStream.close(); } catch (IOException e) { e.printStackTrace(); |
void | close(final InputStream is) Close the input stream quietly consuming any exceptions. close((Closeable) is); |
boolean | close(final InputStream stream) close - Close an InputStream, catching the IOException and returning a value indicating if the exception was thrown. boolean result; try { stream.close(); result = false; } catch (IOException e) { result = true; return result; ... |
void | close(final InputStream stream) close if (stream == null) { return; try { stream.close(); } catch (IOException e) { e.printStackTrace(); |
void | close(final Logger logger, final Closeable... closeables) Close Closeable resource. if (closeables == null || closeables.length == 0) return; for (final Closeable c : closeables) if (c != null) try { c.close(); } catch (final IOException e) { if (logger != null && logger.isDebugEnabled()) ... |
void | close(final Object stream) Closes the given stream if it is closeable, or do nothing otherwise. if (stream instanceof Closeable) { ((Closeable) stream).close(); |