Clears all data and closes/deletes backing temporary file if used.
@throws IOException when something goes wrong.
554263
public void close() throws IOException {
        clear();
        if (_tempfile != null) {
            _tempfile.close();
            _tempfile = null;
            _tempfilef.delete();
            _tempfilef = null;
        }
    }
1089985
public void close()
      throws IOException {
    channel.close();
    mappedFile.close();
    indexBuffer = null;
    dataBuffers = null;
    mappedFile = null;
    channel = null;
    System.gc();
  }
474586
public void close() throws IOException {
        if (!closed) {
            this.finish();
            this.buffer.close();
            out.close();
            closed = true;
        }
    }
742607
public function close()
    {
        if (null !== $this->contents) {
            $result = file_put_contents($this->filename, json_encode($this->contents));
            if (false === $result) {
                throw new IOException('Unable to write to file!');
            }
            $this->contents = null;
        }
    }
132538
public void close() {
        File tmp = new File(webpTmpDir);
        if (tmp.exists() && tmp.isDirectory()) {
            File[] files = tmp.listFiles();
            for (File file : Objects.requireNonNull(files)) {
                file.delete();
            }
            tmp.delete();
        }
    }
609180
@Override
	public void close() throws IOException {
		if (this.in != null) {
			this.in.close();
		}
		if (!this.tempFile.delete()) {
			LOG.warn("Cannot delete tempFile: " + this.tempFile.getAbsolutePath());
			throw new IOException("Cannot delete tempFile: " + this.tempFile.getAbsolutePath());
		}
		;
	}
242915
public void cleanup() {
        if (file != null && file.exists() && !file.delete()) {
            LOGGER.debug("Failed to delete first temporary file {}", file.toString());
            file.deleteOnExit();
        }
    }
684461
public void remove() throws IOException
   {
      if ((fileBuffer != null) && PrivilegedFileHelper.exists(fileBuffer))
      {
         if (!PrivilegedFileHelper.delete(fileBuffer))
         {
            throw new IOException("Cannot remove file " + PrivilegedFileHelper.getAbsolutePath(fileBuffer)
               + " Close all streams.");
         }
      }
   }
229228
public void close ()
        throws IOException
    {
        if (_sock != null) {
            _sock.close();

            // clear out our references
            _sock = null;
            _in = null;
            _out = null;
        }
    }
1121973
public void close() throws IOException {

        writeStream.close();

        if (!writeFile.delete()) {
            throw new IOException(
                RB.singleton.getString(
                    RB.WORKFILE_DELETE_FAIL, writeFile.getAbsolutePath()));
        }
    }
12973
public void close() throws IOException {
        if(inp != null)
            inp.close();
        if(out != null)
            out.close();
    }
1200315
public void clear() throws IOException {
    try {
      zooKeeper.setData(fullyQualifiedZNode, null, expectedZNodeVersion.get());
    } catch (KeeperException.BadVersionException e) {
      LOG.error(fullyQualifiedZNode + " has been updated by another process",
          e);
      throw new StaleVersionException(fullyQualifiedZNode +
          "has been updated by another process!");
    } catch (KeeperException e) {
      keeperException("Unrecoverable ZooKeeper error clearing " +
          fullyQualifiedZNode, e);
    } catch (InterruptedException e) {
      interruptedException("Interrupted clearing " + fullyQualifiedZNode, e);
    }
  }
1311009
public void commit() throws IOException {
        // assures we perform the close operation only once.
        if (open.compareAndSet(true, false)) {
            // flush & close
            fout.force(true);
            fout.close();

            // if the current file exists, and append is true, then append samples and remove temp file
            // otherwise write header and move tmp file to target
            boolean exists = Files.exists(target);
            if (logger.isInfoEnabled()) {
                logger.info("Finishing recording ...... append: " + append + " exists: " + exists + " target:" + target);
            }
            if (append && exists) {
                appendSamples(target, temp);
                writeHeader(target);
                Files.delete(temp);
            } else {
                writeHeader(temp);
                Files.move(temp, target, StandardCopyOption.REPLACE_EXISTING);
            }
        }
    }
1149389
@Override
    public void close() throws IOException {
        if (input instanceof RandomAccessFile) {
            ((RandomAccessFile) input).close();
        }
        else if (input instanceof LittleEndianRandomAccessFile) {
            ((LittleEndianRandomAccessFile) input).close();
        }

        // Other streams are left open
    }
285325
@Override
	@SuppressWarnings("resource")
	public void close() throws IOException {
		flush();

		if (this.tempStream != null) {
			this.tempStream.close();
			this.tempStream = null;
		}

		if (this.stream != null && this.stream.isOpen()) {

			// Copy the channels
			if (this.buffer != null && this.tempFile != null) {
				try {
					try (ReadableByteChannel in = Channels.newChannel(new FileInputStream(this.tempFile))) {
						final ByteBuffer hbuffer = ByteBuffer.allocate(100);
						in.read(hbuffer);

						hbuffer.limit(100);
						hbuffer.position(6 * 4);
						hbuffer.order(ByteOrder.BIG_ENDIAN);
						hbuffer.putInt(toESRIWords(this.bufferPosition));
						hbuffer.rewind();
						this.stream.write(hbuffer);

						int nbRead;
						this.buffer.rewind();

						while ((nbRead = in.read(this.buffer)) >= 0) {
							this.buffer.rewind();
							this.buffer.limit(nbRead);
							this.stream.write(this.buffer);
							this.buffer.rewind();
							this.buffer.limit(this.buffer.capacity());
						}
					}

				} finally {
					this.tempFile.delete();
					this.tempFile = null;
				}

			}
			this.stream.close();
		}
	}
774066
public void close() throws IOException
  {
    if (_isKeepalive) {
      // If recycling, read any unread data
      if (! _didGet)
        getConnInput();

      if (! _isRequestDone) {
        if (_tempBuffer == null)
          _tempBuffer = new byte[256];

        try {
          while (read(_tempBuffer, 0, _tempBuffer.length) > 0) {
          }
        } catch (IOException e) {
          _isKeepalive = false;
        }
      }
    }

    if (_isKeepalive) {
      HttpStream oldSaved;
      
      long now;
      
      now = CurrentTime.currentTime();
      
      synchronized (LOCK) {
        oldSaved = _savedStream;
        _savedStream = this;
        _saveTime = now;
      }

      if (oldSaved != null && oldSaved != this) {
        oldSaved._isKeepalive = false;
        oldSaved.close();
      }

      return;
    }

    try {
      try {
        if (_ws != null)
          _ws.close();
      } catch (Throwable e) {
      }
      _ws = null;

      try {
        if (_rs != null)
          _rs.close();
      } catch (Throwable e) {
      }
      _rs = null;

      try {
        if (_os != null)
          _os.close();
      } catch (Throwable e) {
      }
      _os = null;

      try {
        if (_is != null)
          _is.close();
      } catch (Throwable e) {
      }
      _is = null;
    } finally {
      if (_s != null)
        _s.close();
      _s = null;
    }
  }
692063
public void close() throws IOException {
        if (dataStream != null) dataStream.close();
        byteStream = null;
        dataStream = null;
    }