/*
(non-Javadoc)

@see java.io.OutputStream#close()
195340
public void close() throws IOException {
        if (!_closed) {
            try {
                flush();
            } catch (Throwable t) {
                LOG.debug(t.getMessage(), t);
            }
            _closed = true;
            super.close();
        }
    }
904358
public void close()
	{
		if (inputStream == null)
		{
			return;
		}
		try
		{
			inputStream.close();
		}
		catch (Exception e)
		{
			listener.exceptionThrown(e);
		}
	}
236381
public final void close() {
        if (m_stream==null) {
            return;
        }
        try {
            m_stream.close();
        }
        catch (IOException e) {
        }
        if (m_nextException==null) {
            m_nextException=new IOException("Closed.");
        }
        m_stream=null;
        resetState();
    }
474586
public void close() throws IOException {
        if (!closed) {
            this.finish();
            this.buffer.close();
            out.close();
            closed = true;
        }
    }
276513
public void close() throws IOException
  {
    HttpStream stream = _stream;
    _stream = null;

    if (stream != null)
      stream.close();
  }
885439
public void close() {
        if (this.m_stream != null) {
            try {
                this.m_stream.close();
                this.m_stream = null;
            } catch (IOException e) {
                logger.warn("Error closing stream", e);
            }
        }
    }
1187800
@Override
  public void close() {
    try {
      if ( content != null ) content.close();
    } catch (XMLStreamException e) {
      logger.error("Failed to close underlying XMLStreamReader",e);
      throw new MarkLogicIOException(e);
      // whether that failed or not, attempt to close underlying InputStream
    } finally {
      if ( contentSource != null ) {
        try {
          contentSource.close();
        } catch (IOException e) {
          logger.error("Failed to close underlying InputStream",e);
          throw new MarkLogicIOException(e);
        }
      }
    }
  }
952744
@Override
    public void close() {
        target.kill();
        try {
            thread.join();
            target.consoleStream.print("\n");
            target.consoleStream.flush();
            target.terminal.close();
        }
        catch (InterruptedException | IOException ignored) { }
    }
775380
@Override
    public void close() {
        if (this.inputStream != null) {
            try {
                this.inputStream.close();
            } catch (final IOException e) {
                // Ignore
            }
            this.inputStream = null;
        }
        this.byteBuffer = null;
        this.buf = null;
    }
1285784
public void close() {
    proc.destroy();
    try {
      inStream.close();
      outStream.close();
      errStream.close();
    } catch (IOException ignored) {
    }
    inStream = null;
    outStream = null;
    errStream = null;
    proc = null;
  }
1176222
protected synchronized void close() {

        this.closed = true;

        setReadable(false);
        setWritable(false);
        freeOutputStream();
        freeInputStream();

        this.gzdata = null;
    }
1145934
@Override
    public void close() throws IOException {
        try {
            if (reference != null) {
                closer.close(reference);
            }
        } catch (Exception e) {
            throw new IOException(e);
        } finally {
            this.wasClosed = true;
        }
    }
796227
@JSFunction
    public void close() throws IOException {
        if (reader != null) {
            reader.close();
            reader = null;
        } else if (writer != null) {
            writer.close();
            writer = null;
        }
    }
17799
public void close()
        throws IOException
    {
        try{
            _completing=true;
            if (_connection instanceof Socket && !(_connection instanceof SSLSocket))
                ((Socket)_connection).shutdownOutput();
            _outputStream.close();
            _inputStream.close();
        }
        finally
        {
            if (_handlingThread!=null && Thread.currentThread()!=_handlingThread)
                _handlingThread.interrupt();
        }
    }
863628
public void close()
        throws IOException
    {
        InputStream is = _is;
        _is = null;

        if (is != null)
            is.close();

        _state.println();
    }
719188
@Override
    public void close() throws IOException {
        if (isClosed()) {
            return;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Closing stream: hc: " + this.hashCode() + " details: " + this);
        }
        this.closed = true;
        this.ignoreFlush = false;
        try {
            flushBuffers();
        } finally {
            // must release the buffers even if the flush fails
            clear();
        }
    }
263110
public void close()
  {
    StreamSource ss = _indirectSource;
    _indirectSource = null;
    
    if (ss != null) {
      ss.freeUseCount();
    }
    else {
      freeUseCount();
    }
  }