List of utility methods to do Stream Close
void | closeProcess(Process process) close Process try { process.getInputStream().close(); process.getOutputStream().close(); process.getErrorStream().close(); } catch (IOException e) { process.destroy(); try { ... |
void | closeProcessStreams(Process p) close Process Streams if (p != null) {
closeQuietly(p.getOutputStream());
closeQuietly(p.getInputStream());
closeQuietly(p.getErrorStream());
|
Writer | closeProofWriter(Writer out) close Proof Writer return new Writer(out) { @Override public void close() throws IOException { @Override public void write(char[] cbuf, int off, int len) throws IOException { out.write(cbuf, off, len); @Override public void flush() throws IOException { out.flush(); }; |
OutputStream | closeProtectedStream(final OutputStream outputStream) close Protected Stream return new OutputStream() { @Override public void write(int b) throws IOException { outputStream.write(b); @Override public void close() throws IOException { }; |
void | closeQietly(ZipFile zipFile) close Qietly try { zipFile.close(); } catch (final IOException e) { throw new RuntimeException(e); |
void | closeQuietly(@Nullable ObjectInput in) Method that will close an ObjectInput ignoring it if it is null and ignoring exceptions. if (in != null) { try { in.close(); } catch (IOException e) { |
void | closeQuietly(BufferedReader br) close Quietly if (br != null) { try { br.close(); } catch (IOException e) { |
void | closeQuietly(Closeable input, Logger log) Close I/O object quietly without exception but using external logger for logging errors if any try { if (input != null) { input.close(); } catch (IOException ioe) { log.warn("'close' invocation exception for resource: " + input.getClass().getName(), ioe); |
void | closeQuietly(Closeable stream) Close a stream, ignores checked Exceptions and nulls, but rethrows RuntimeExceptions. if (stream != null) { try { stream.close(); } catch (RuntimeException rethrow) { throw rethrow; } catch (Exception e) { logger.warn(e.getMessage()); |
void | closeQuietly(Closeable stream) Unconditionally close an InputStream .
try { if (stream != null) { stream.close(); } catch (IOException ioe) { |