List of utility methods to do Stream Close
void | closeCloseableIfNotNull(Closeable fileWriter) close Closeable If Not Null if (fileWriter != null) { try { fileWriter.close(); } catch (IOException e) { e.printStackTrace(); |
void | closeConnection(Closeable... closes) close Connection for (Closeable close : closes) { try { if (close != null) { close.close(); } catch (IOException e) { e.printStackTrace(); |
void | closeDataLine(final SourceDataLine line, final AudioInputStream ais) close Data Line line.drain(); line.stop(); line.close(); ais.close(); |
void | closeDebugFile() close Debug File debugFileName = null; if (debugStream == null) { return; debugStream.close(); debugStream = null; |
void | closeEL(InputStream is) close inputstream without a Exception try { if (is != null) is.close(); } catch (Throwable e) { |
void | closeEntry(ZipOutputStream... outputStreams) Equivalent to ZipOutputStream#closeEntry() but without checked exception. for (final ZipOutputStream outputStream : outputStreams) { try { outputStream.closeEntry(); } catch (final IOException e) { throw new RuntimeException(e); |
void | closeFile() close File writer.close(); |
void | closeFile() close File try { writer.close(); } catch (IOException e) { e.printStackTrace(); |
void | closeFile(File file, boolean toBeDeleted) Closes the file handle for temporary file. if (file != null) { updateFileHandle(file, null, true); if (toBeDeleted) { boolean deleted = file.delete(); if (!deleted) { throw new IOException("Failed to delete temporary file " + file.getName()); |
void | closeFile(File file, RandomAccessFile raf) Close the file and automatically releases the FileLock (if any) and removes the advisory lock for that file (if any). if (file == null) throw new IllegalArgumentException(); if (raf == null) throw new IllegalArgumentException(); try { if (raf.getChannel().isOpen()) { raf.close(); } finally { removeAdvisoryLock(file); |