@Override public void close() throws IOException { // getInputStream() is not always called (WICKET-790) IOUtils.close(in); }
IOUtils.close(inputStream);
IOUtils.close(inputStream);
@Override public void close() throws IOException { // getInputStream() is not always called (WICKET-790) IOUtils.close(in); }
/** * Unconditionally close a <code>Closeable</code>. * <p> * closeables can be input or output streams, reader, writers, and much more. * * Equivalent to {@link Closeable#close()}, except any exceptions will be ignored. This is * typically used in finally blocks. * * @param closeable * the Closeable to close, may be null or already closed */ public static void closeQuietly(final Closeable closeable) { try { close(closeable); } catch (IOException e) { log.debug("closing resource failed: " + e.getMessage(), e); } }
IOUtils.close(oos);
IOUtils.close(oos);
IOUtils.close(lineNumberReader);
/** * compute checksum for resource stream * * @param inputStream input stream to compute checksum for * @return binary checksum * @throws IOException if there are any io problems */ @Override protected byte[] computeDigest(final InputStream inputStream) throws IOException { final Checksum checksum = newChecksumBuilder(); final byte[] bytes = new byte[bufferSize()]; int len; try { while ((len = inputStream.read(bytes)) >= 0) { checksum.update(bytes, 0, len); } } catch (RuntimeException e) { checksum.reset(); throw e; } finally { IOUtils.close(inputStream); } return stripNonVisibleChars(Long.toHexString(checksum.getValue())).getBytes(charset()); }
IOUtils.close(stream);
IOUtils.close(stream);
IOUtils.close(ois);
IOUtils.close(ois);
IOUtils.close(resourceStream);
IOUtils.close(resourceStream);