Closes our streams. It's up to you
to close any {@link OggPacketWriter} instances
first!
12973
public void close() throws IOException {
        if(inp != null)
            inp.close();
        if(out != null)
            out.close();
    }
78331
public void close() throws IOException {
        if (closeRequested)
            return;
        guard.close();
        closeRequested = true;

        synchronized (this) {
            // Close streams, release their inflaters
            synchronized (streams) {
                if (false == streams.isEmpty()) {
                    Map<InputStream, Inflater> copy = new HashMap<>(streams);
                    streams.clear();
                    for (Map.Entry<InputStream, Inflater> e : copy.entrySet()) {
                        e.getKey().close();
                        Inflater inf = e.getValue();
                        if (inf != null) {
                            inf.end();
                        }
                    }
                }
            }

            // Release cached inflaters
            Inflater inf;
            synchronized (inflaterCache) {
                while (null != (inf = inflaterCache.poll())) {
                    inf.end();
                }
            }

            if (jzfile != 0) {
                // Close the zip file
                long zf = this.jzfile;
                jzfile = 0;

                close(zf);
            }

            // Android-changed, explicit delete for OPEN_DELETE ZipFile.
            if (fileToRemoveOnClose != null) {
                fileToRemoveOnClose.delete();
            }
        }
    }
525129
@Override
    public void close() {
        if (this.closed.compareAndSet(false, true)) {
            this.extensions.values().forEach(SegmentContainerExtension::close);
            Futures.await(Services.stopAsync(this, this.executor));
            this.metadataCleaner.close();
            this.writer.close();
            this.durableLog.close();
            this.readIndex.close();
            this.storage.close();
            log.info("{}: Closed.", this.traceObjectId);
        }
    }
894069
public void close() {
    if (lock != null) {
      lock.lock();
    }
    this.connected = false;
    try {
      /* If a streaming result set is open, close it.*/
      skip();
    } catch (Exception e) {
      /* eat exception */
    }

    SendClosePacket.send(writer);
    closeSocket(reader, writer, socket);
    cleanMemory();
    if (lock != null) {
      lock.unlock();
    }
  }
1001183
@Override
  public final void close()
  {
    try {
      if (_disableClose)
        return;

      if (! _reuseBuffer) {
        if (_tempRead != null) {
          TempBuffer tempBuffer = _tempRead;
          _tempRead = null;

          TempBuffer.free(tempBuffer);
        }
        _readBuffer = null;
      }

      if (_readEncoding != null) {
        Reader reader = _readEncoding;
        _readEncoding = null;
        reader.close();
      }

      if (_source != null && ! _isDisableCloseSource) {
        StreamImpl s = _source;
        _source = null;
        s.close();
      }
    } catch (IOException e) {
      log().log(Level.FINE, e.toString(), e);
    }
  }
937513
@Override
  public void closeWrite() throws IOException
  {
    if (_isWriteClosed) {
      return;
    }
    
    _isWriteClosed = true;
    
    StreamImpl stream = _streamImpl;
    
    if (stream != null) {
      stream.closeWrite();
    }
    else if (_sslSocket != null) {
      _sslSocket.getOutputStream().close();
    }
    else if (_channel != null) {
      try {
        _channel.shutdownOutput();
      } catch (UnsupportedOperationException e) {
        log.log(Level.FINEST, e.toString(), e);
      } catch (Exception e) {
        log.finer(e.toString());
        log.log(Level.FINEST, e.toString(), e);
      }
    }
  }
1151424
@Override
    protected void dispose() {
        try {
            if (generator != null) {
                generator.writeEndArray();
                generator.close();
            }
            this.getOutputStream().close();
        } catch (IOException ioe) {
            logger.error("Unable to close stream", ioe);
            logger.trace(ioe.getMessage(), ioe);
        } finally {
            generator = null;
            this.setOutputStream(null);
        }
    }
1222441
@Override
  public void close() {
    if (mClosed.getAndSet(true)) {
      return;
    }
    try {
      mLocalOutputStream.close();
      mKodoClient.uploadFile(mKey, mFile);
    } catch (Exception e) {
      e.printStackTrace();
    }
    mFile.delete();
  }
1304627
public function closeInputStream()
    {
        if (!is_null($this->_inputStream)) {
            fclose($this->_inputStream);
            $this->_inputStream = null;
        }
    }
943578
@Override
    public void close()
        throws IOException
    {
        OutputStream os = _os;
        _os = null;

        if (os != null) {
            _state.next(-1);
            os.close();
        }

        _state.println();
    }
1110815
@Override
  public synchronized void close() throws Exception {
    if (this.readerWriter != null && !this.writerClosed) {
      this.readerWriter.close();
      this.writerClosed = true;
    }
  }
998917
public void close() {
        //log.debug("Stream close: {}", publishedName);
        if (closed.compareAndSet(false, true)) {
            if (livePipe != null) {
                livePipe.unsubscribe((IProvider) this);
            }
            // if we have a recording listener, inform that this stream is done
            if (recordingListener != null) {
                sendRecordStopNotify();
                notifyRecordingStop();
                // inform the listener to finish and close
                recordingListener.get().stop();
            }
            sendPublishStopNotify();
            // TODO: can we send the client something to make sure he stops sending data?
            if (connMsgOut != null) {
                connMsgOut.unsubscribe(this);
            }
            notifyBroadcastClose();
            // clear the listener after all the notifications have been sent
            if (recordingListener != null) {
                recordingListener.clear();
            }
            // clear listeners
            if (!listeners.isEmpty()) {
                listeners.clear();
            }
            // deregister with jmx
            unregisterJMX();
            setState(StreamState.CLOSED);
        }
    }
757767
public void close() throws IOException {

		//PrintWriter.close does not throw exceptions. Thus, the call does not need
		//be inside a try-catch block.
		if (this.printWriter != null) {
			this.printWriter.close();
		}

		if (this.gzipOutputStream != null) {
			this.gzipOutputStream.close();
		}
	}
416437
@Override
    public void close() throws IOException
    {
        if (!isClosed)
        {
            flush();
            if (closeChannel)
            {
                channel.close();
            }
            isClosed = true;
        }
    }
1094811
@Override
  public void close() throws IOException {
    if (!closed) {
      objectOutputStream.close();
      fileOutputStream.close();
      closed = true;
    }
  }
1343725
@Override
  public void close()
    throws IOException
  {
    if (_isClosed.getAndSet(true)) {
      return;
    }

    _ss = null;

    if (_stream != null) {
      _stream.close();
    }

    // XXX: can't be locked because of shutdown

    _nativeFd = -1;
    nativeClose(_socketFd);
  }
880448
@Override
    public final void close() {
        dispose();

        if (this.outputStream != null) {
            try {
                this.outputStream.close();
            } catch (IOException ioe) {
                logger.error("Unable to close output stream.", ioe);
            } finally {
                this.outputStream = null;
            }
        }
    }