Closes underlying output stream and writes nulls to all the internal fields.
No metrics should be written from any other thread when this object is closed.

@throws IOException On I/O error when closing output stream
{@inheritDoc}
515164
@Override
  public void close() throws IOException {
    final MapAppender appender = mapAppender;
    if (appender != null) {
      appender.close();
    }
    mapAppender = null;

    recordCache = null;
  }
276513
public void close() throws IOException
  {
    HttpStream stream = _stream;
    _stream = null;

    if (stream != null)
      stream.close();
  }
1095235
@Override
    public void close() throws IOException {
        if (!closed) {
            closed = true;
            nodeCursor = null;
            _currToken = null;
        }
    }
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();
        }
    }
863628
public void close()
        throws IOException
    {
        InputStream is = _is;
        _is = null;

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

        _state.println();
    }
432506
@Override
  public void closeWrite() throws IOException
  {
    if (_isCloseWrite) {
      return;
    }
    
    _isCloseWrite = true;
    
    OutputStream os = _os;
    _os = null;
    
    boolean isShutdownOutput = false;

    // since the output stream is opened lazily, we might
    // need to open it
    if (_s instanceof SSLSocket) {
      // ssl socket cannot be half-closed
      log.finer(L.l("sslSocket can not be half-closed"));
      return;
    }
    else if (_s != null) {
      try {
        _s.shutdownOutput();
        
        isShutdownOutput = true;
      } catch (UnsupportedOperationException e) {
        log.log(Level.FINEST, e.toString(), e);
      } catch (Exception e) {
        log.finer(e.toString());
        log.log(Level.FINEST, e.toString(), e);
      }
    }

    // SSLSocket doesn't support shutdownOutput()
    if (! isShutdownOutput && os != null) {
      os.close();
    }
  }
675186
public void writeTo (@Nonnull @WillNotClose final OutputStream aOS) throws IOException
  {
    // we may only need to check if this is closed if we are working with a file
    // but we should force the habit of closing whether we are working with
    // a file or memory.
    if (!m_bClosed)
      throw new IOException ("This stream is not closed");

    if (isInMemory ())
    {
      m_aMemoryOS.writeTo (aOS);
    }
    else
    {
      final InputStream aIS = FileHelper.getInputStream (m_aOutputFile);
      StreamHelper.copyInputStreamToOutputStream (aIS, aOS);
    }
  }
1311417
@Override
  public void close() throws IOException
  {
    Socket s = _s;
    _s = null;

    OutputStream os = _os;
    _os = null;

    InputStream is = _is;
    _is = null;

    try {
      if (os != null)
        os.close();
      
      if (is != null)
        is.close();
    } finally {
      if (s != null)
        s.close();
    }
  }
1089786
public static void safelyClose(OutputStream stream) {
		if(stream != null) {
			try {
				stream.close();
			} catch(IOException e) {
				logger.warn("error closing internal output stream, this may lead to a stream leak", e);
			}
		}
	}
801158
@Override
    public void close() throws IOException {
        try {
            if (!m_closed) {
                receiver.closeFile();
                m_closed= true;
            }
        } catch (JournalException e) {
            throw new IOException(e);
        }
    }
1169544
@Override
    public void close () throws IOException {
        try {
            if ( this.handle.isValid() ) {
                this.handle.close();
            }
        }
        finally {
            this.file.clearAttributeCache();
            this.tmp = null;
        }
    }
943578
@Override
    public void close()
        throws IOException
    {
        OutputStream os = _os;
        _os = null;

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

        _state.println();
    }
1089985
public void close()
      throws IOException {
    channel.close();
    mappedFile.close();
    indexBuffer = null;
    dataBuffers = null;
    mappedFile = null;
    channel = null;
    System.gc();
  }
806139
@Override
	public void close() throws IOException {
		if (curr != null) {
			curr.close();
		}
		Reader reader;
		while ((reader = getNextInputReader()) != null) {
			reader.close();
		}
		closed = true;
	}
474586
public void close() throws IOException {
        if (!closed) {
            this.finish();
            this.buffer.close();
            out.close();
            closed = true;
        }
    }
538973
public void close() throws IOException {
		if (writer != null) {
			writer.close();
		} else if (stream != null) {
			stream.close();
		}
	}
575838
public void close() throws IOException {
        if (mPositionReader != null) {
            mPositionReader.close();
        }

        mPositionReader = null;
        mPositionReaderUnit = null;
    }