code: @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();
      }
    }
docs: Closes the write half of the stream.