Flushes the stream if it's not closed and checks its error state.

@return <code>true</code> if the print stream has encountered an error,
either on the underlying output stream or during a format
conversion.
436063
public boolean checkError() {
        if (out != null) {
            flush();
        }
        if (out instanceof java.io.PrintWriter) {
            PrintWriter pw = (PrintWriter) out;
            return pw.checkError();
        } else if (psOut != null) {
            return psOut.checkError();
        }
        return trouble;
    }
1128464
public static boolean flush(final OutputStream[] streams) {
      boolean success = true;

      for (OutputStream stream : streams) {
         boolean rv = flush(stream);
         if (!rv) success = false;
      }

      return success;
   }
119573
def flush(self):
        
        self._write_all(self._wbuffer.getvalue())
        self._wbuffer = StringIO()
        return
97466
@Override
    public synchronized void close() {
        if (currentStatus != StreamStatus.CLOSED) {
            // Only flush the print stream: don't close it.
            currentPrintStream.flush();

            if (!LoggingFileUtils.tryToClose(currentPrintStream)) {
                LoggingFileUtils.tryToClose(currentFileStream);
            }

            // Send to bit bucket again-- this holder is done (false -- do not replace)
            setStreamStatus(StreamStatus.CLOSED, null, null, DummyOutputStream.psInstance);
        }
    }
758723
public void flush() {
    if(inline.length() > 0) {
      outStream.println(inline);
    }
    inline.setLength(0);
    if(comment.length() > 0) {
      quotePrintln(outStream, comment.toString());
    }
    comment.setLength(0);
  }
500473
@Override
    public void flush() throws IOException {
        checkWriter();
        writer.flush();
        try {
            contentStoreUtil.storeContentStream(tempFile,
                                                spaceId,
                                                contentId,
                                                mimetype);
        } catch (DuraCloudRuntimeException ex) {
            throw new IOException("flush failed: " + ex.getMessage(), ex);
        }
    }
533188
public synchronized void flush(boolean bSendFakeTrx)
    {
        try {
            if (bSendFakeTrx)
                this.getWriter().writeObject(FAKE_TRX);
            this.getWriter().flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
734326
@Override
    @FFDCIgnore({ IOException.class })
    public void flushHeaders() throws IOException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "flushHeaders: committed=" + this.isc.getResponse().isCommitted());
        }
        validate();
        this.ignoreFlush = false;
        if (!this.isc.getResponse().isCommitted()) {
            this.isc.getResponse().setCommitted();
        } else {
            // response headers already committed (written)
            return;
        }
        try {
            this.isc.sendResponseHeaders();
        } catch (MessageSentException mse) {
            FFDCFilter.processException(mse, getClass().getName(),
                                        "flushHeaders", new Object[] { this, this.isc });
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Invalid state, message-sent-exception received; " + this.isc);
            }
            this.error = new IOException("Invalid state");
            throw this.error;
        } catch (IOException ioe) {
            // no FFDC required
            this.error = ioe;
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Received exception during write: " + ioe);
            }
            throw ioe;
        }
    }
465631
public static function flushBuffer()
    {
        if (self::$_page && ob_get_length()) {
            self::$_zones[self::$_outputZone]->append(ob_get_clean());
            ob_start();
            return true;
        }
        return false;
    }
1178503
public void flush()
  {
    Writer out = this.out;
    if (out == null)
      return;

    try {
      out.flush();
    } catch (IOException e) {
      log.log(Level.FINE, e.toString(), e);
    }
  }
768397
def close_stream(self):
        
        if self.fout:
            fout = self.fout
            fout_fn = self.fout_fn
            self.fout.flush()
            self.fout.close()
            self.fout = None
            self.fout_fn = None
            return fout_fn
1208461
def _close(self):
        

        if self.stream:
            try:
                if not self.stream.closed:
                    # Flushing probably isn't technically necessary, but it feels right
                    self.stream.flush()
                    self.stream.close()
            finally:
                self.stream = None
1250007
public void flushResponse() throws IOException {
        try {
            // Finish GZIP encodig
            if (gzipOut != null) {
                gzipOut.finish();
            }

            flushBuffer();
        }
        finally {
            // Close stream
            if (writer != null) {
                writer.close();
            }
            else {
                if (out != null) {
                    out.close();
                }
            }
        }
    }
605797
public synchronized void flush()
	{
		if (out != null)
			try {
				out.flush();
			}
			catch (final IOException e) {
				getErrorHandler().error(this, "on flush", e);
			}
	}
231616
@Override
    public synchronized void flush() throws IOException {
        ensureOpen();
        if (decodedBuf.position() > 0) {
            decodedBuf.flip();
            String contents = decodedBuf.toString();
            String filtered = contentFilter.filter(contents);
            out.write(filtered.getBytes(charset));
            decodedBuf.clear();
        }
        out.flush();
    }
13315
private void flushOutput() throws IOException {
    outStream.flush();
    outWriter.completeLine();
    errStream.flush();
    errWriter.completeLine();
  }
375490
public final void flush() throws IOException
    {
        if (! _closed)
        {
            if (atDatagramLevel() && ! hasAnnotations())
            {
                SymbolTable symtab = getSymbolTable();

                if (symtab != null &&
                    symtab.isReadOnly() &&
                    symtab.isLocalTable())
                {
                    // It's no longer possible to add more symbols to the local
                    // symtab, so we can safely write everything out.
                    writeAllBufferedData();
                }
            }

            _user_output_stream.flush();
        }
    }