<p class="changed_added_2_0">Write the end of a partial response.</p>

@throws IOException if an input/output error occurs
@since 2.0
514058
public void endDocument() throws IOException {
        endChangesIfNecessary();
        ResponseWriter writer = getWrapped();
        /*
         * Because during a <script> writing an exception can occur we need to
         * make sure the wrapped response only writes one partial-response, but
         * also calls to end the document (so we can properly cleanup in the 
         * wrapped HtmlResponseWriter). See issue #3473.
         */
        if (!(writer instanceof PartialResponseWriter)) {
            writer.endElement("partial-response");
        }
        writer.endDocument();
    }
996958
public void writeContent(final OutputStream result) throws IOException
    {
        if(this.mode == MODE_SINGLE) {
        	headerAll.writeContent(result);
        } else if(this.mode == MODE_MULTIPLE) {
            if(headerFirst != null) {
            	headerFirst.writeContent(result);
            }
            if(headerLeft != null) {
                headerLeft.writeContent(result);
            }
            if(headerRight != null) {
                headerRight.writeContent(result);
            }
            if(headerAll != null) {
                headerAll.writeContent(result);
            }
        }
    }
719943
public void write()
        throws IOException
    {
        BufferedWriter writer = new BufferedWriter( new OutputStreamWriter( m_outputStream ) );
        for( String line : m_content )
        {
            writer.write( line );
            writer.newLine();
        }
        writer.flush();
        writer.close();
    }
1300717
@Override
  public void write(DataOutput out) throws IOException {
    Text.writeString(out, file.toString());
    out.writeLong(start);
    out.writeLong(length);
  }
13315
private void flushOutput() throws IOException {
    outStream.flush();
    outWriter.completeLine();
    errStream.flush();
    errWriter.completeLine();
  }
192924
public void finish() throws IOException {
        if (printWriter != null) {
            printWriter.close();
        }

        if (outputStream != null) {
            outputStream.close();
        }
    }
905420
public void finish() throws IOException {
    writer.append("--" + boundary + "--").append(LINE_BREAK);
    writer.flush();
    writer.close();
    outputStream.flush();
    outputStream.close();
  }
824039
@Override
  public void write(byte []buf, int offset, int length, boolean isEnd)
    throws IOException
  {
    OutputStream stream = getStream();

    if (stream == null) {
      return;
    }

    synchronized (stream) {
      stream.write(buf, offset, length);
      
      if (isEnd) {
        stream.flush();
      }
    }
  }
324978
public void write(OutputStream out) throws IOException
    {
        if (log.isTraceEnabled())
            log.trace("AJP13 snd: "+this.toString(64));
        // System.err.println(Thread.currentThread()+" AJP13 snd
        // "+this.toString());
        out.write(_buf,0,_bytes);
    }
214237
public void write(DataOutput out) throws IOException
    {
        out.writeUTF(startToken);
        out.writeUTF(endToken);
        out.writeInt(dataNodes.length);
        for (String endpoint : dataNodes)
        {
            out.writeUTF(endpoint);
        }
    }
554487
private void respond(BufferedWriter out, String response) throws IOException {
        out.append(response);
        out.append("\n");
        out.flush();
    }
1320546
protected synchronized void write(int b) throws IOException {
		if (closed) {
			throw new IOException("The buffer is closed");
		}

		verifyBufferSize(1);
		buf[writepos] = (byte) b;
		writepos++;

		notifyAll();
	}
688554
public void write(int b) throws IOException
	{
		//PK89810, If WCCustomProperties.FINISH_RESPONSE_ON_CLOSE is set and stream is already obtained and closed. 
		// User will not be allowed to write more data if the above case is met, outputstreamClosed will be true and default is false.
		if (!(WCCustomProperties.FINISH_RESPONSE_ON_CLOSE) || !outputstreamClosed ) //PK89810
		{
		if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
			logger.logp(Level.FINE, CLASS_NAME,"write", "write --> "+b);
        }
		if (!_hasWritten && obs != null)
		{
			_hasWritten = true;
			if (obsList!=null){
				for (int i=0;i<obsList.size();i++){
					obsList.get(i).alertFirstWrite();
				}
			}
			else {
			obs.alertFirstWrite();
		}
		}
		if (limit > -1)
		{
			if (total >= limit)
			{
				throw new WriteBeyondContentLengthException();
			}
		}
		if (count == buf.length)
		{
			response.setFlushMode(false);
			flushBytes();
			response.setFlushMode(true);
		}
		buf[count++] = (byte) b;
		total++;
	}
		else
		{//PK89810 start
			if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))
				logger.logp(Level.FINE, CLASS_NAME,"write", " write not allowed, outputstreamClosed value -->" + outputstreamClosed);
			
		}//PK89810 End
	}
499021
public void write(byte []buf, int offset, int length, boolean isEnd)
    throws IOException
  {
    System.out.write(buf, offset, length);
    System.out.flush();
  }
426859
@Override
    public void write(int b)
            throws IOException
    {
        if (closed) {
            throw new IOException("Stream is closed");
        }
        if (inputCursor >= inputBuffer.length) {
            compressInput();
        }
        inputBuffer[inputCursor++] = (byte) b;
    }
130962
private void writeFieldResultEnd(final OutputStream result) throws IOException 
    {
        result.write(DELIMITER);
        result.write(CLOSE_GROUP);
    }
417163
protected final void writeLEInt(int v) throws IOException {
		ensureAvailableBytes(4);
		this.buffer.order(ByteOrder.LITTLE_ENDIAN);
		this.buffer.putInt(v);
	}