/*-------------------------------------------------[ closeOutputs ]---------------------------------------------------
7326
protected void closeInputs() throws IOException{
        while(true){
            if(in instanceof Transport)
                return;
            in.close();
            in = in.detachInput();
        }
    }
109725
private void emitCodeLines(final StringBuilder out, final Line lines, final String meta, final boolean removeIndent)
    {
        Line line = lines;
        if (this.config.codeBlockEmitter != null)
        {
            final ArrayList<String> list = new ArrayList<String>();
            while (line != null)
            {
                if (line.isEmpty)
                {
                    list.add("");
                }
                else
                {
                    list.add(removeIndent ? line.value.substring(4) : line.value);
                }
                line = line.next;
            }
            this.config.codeBlockEmitter.emitBlock(out, list, meta);
        }
        else
        {
            while (line != null)
            {
                if (!line.isEmpty)
                {
                    for (int i = removeIndent ? 4 : 0; i < line.value.length(); i++)
                    {
                        final char c;
                        switch (c = line.value.charAt(i))
                        {
                        case '&':
                            out.append("&amp;");
                            break;
                        case '<':
                            out.append("&lt;");
                            break;
                        case '>':
                            out.append("&gt;");
                            break;
                        default:
                            out.append(c);
                            break;
                        }
                    }
                }
                out.append('\n');
                line = line.next;
            }
        }
    }
883274
protected void onClose(final int closeCode, final String reason) {
        postCloseEvent(WebSocketCloseCode.getByCodeOrElse(closeCode, WebSocketCloseCode.ABNORMAL), reason);
    }
147224
@Override
    public void closeMappingFiles() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "closeMappingFiles", mapFileInputStreams);
        }
        // go through each mapping input stream and close the file.
        for (InputStream inputStream : mapFileInputStreams) {
            try {
                inputStream.close();
            } catch (Throwable t) {
                FFDCFilter.processException(t, CLASS_NAME + ".closeMappingFiles", "573");
                // log the close failed in a debug and keep going.
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Closing InputStream failed " + inputStream);
                }
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "closeMappingFiles", mapFileInputStreams);
        }
    }
371487
function checkOutput() {
        // Note that we shift the output array here.
        const getNextOutputBlock = () => R.defaultTo('', output.shift());

        let isFound = false;

        do {
          isFound = R.contains(text, getNextOutputBlock());
        } while (!isFound && !R.isEmpty(output));

        if (isFound) {
          clearInterval(intervalID);
          resolve();
        }
      }
388152
@Handler
    @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
    public void onSaveOutput(SaveOutput event) throws InterruptedException {
        if (!Arrays.asList(event.options())
            .contains(StandardOpenOption.WRITE)) {
            throw new IllegalArgumentException(
                "File must be opened for writing.");
        }
        for (IOSubchannel channel : event.channels(IOSubchannel.class)) {
            if (outputWriters.containsKey(channel)) {
                channel.respond(new IOError(event,
                    new IllegalStateException("File is already open.")));
            } else {
                new Writer(event, channel);
            }
        }
    }
283540
public static void close (OutputStream out)
    {
        if (out != null) {
            try {
                out.close();
            } catch (IOException ioe) {
                log.warning("Error closing output stream", "stream", out, "cause", ioe);
            }
        }
    }
1139034
public void setOutputStyle(final String outputStyle) {
        if (outputStyle == null && this.outputStyle == null) {
            return;
        } else if (outputStyle == null) {
            removeChild(this.outputStyle);
            this.outputStyle = null;
        } else if (this.outputStyle == null) {
            this.outputStyle = new KeyValueNode<String>(CSConstants.OUTPUT_STYLE_TITLE, outputStyle);
            appendChild(this.outputStyle, false);
        } else {
            this.outputStyle.setValue(outputStyle);
        }
    }
933234
private final void _close(boolean forceClosing)
        throws IOException
    {
        byte[] buf = mOutBuffer;
        if (buf != null) {
            mOutBuffer = null;
            if (mOutPtr > 0) {
                mOut.write(buf, 0, mOutPtr);
                mOutPtr = 0;
            }
            if (mConfig != null) {
                mConfig.freeFullBBuffer(buf);
            }
        }

        if (forceClosing) {
            mOut.close();
        }
        
        /* Let's 'flush' orphan surrogate, no matter what; but only
         * after cleanly closing everything else.
         */
        int code = mSurrogate;
        if (code > 0) {
            mSurrogate = 0;
            throwIllegal(code);
        }
    }
480180
private KieServerHttpRequest openOutput() throws IOException {
        if( output != null ) {
            return this;
        }
        getConnection().setDoOutput(true);
        final String charset = getHeaderParam(getConnection().getRequestProperty(CONTENT_TYPE), PARAM_CHARSET);
        output = new RequestOutputStream(getConnection().getOutputStream(), charset, bufferSize);
        return this;
    }
4908
public void setOutputs(java.util.Collection<Output> outputs) {
        if (outputs == null) {
            this.outputs = null;
            return;
        }

        this.outputs = new com.amazonaws.internal.SdkInternalList<Output>(outputs);
    }
682848
function setOutput(msg, outputType, output, value) {
      try {
        switch ( outputType ) {
          case 'msg':
            RED.util.setMessageProperty(msg, output, value);
            break;
          case 'flow':
            node.context().flow.set(output, value);
            break;
          case 'global':
            node.context().global.set(output, value);
            break;
          default:
            node.warn('Unrecognised Output Type, ' + outputType + '. No output.');
        }
      } catch (err) {
        node.warn('Output property, ' + outputType + '.' + output + ', cannot be set. No output.', err);
      }
    }
614460
@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 != 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();
    }
    */
  }
986557
public static void closeEL(Object obj) {
	if (obj instanceof InputStream) IOUtil.closeEL((InputStream) obj);
	else if (obj instanceof OutputStream) IOUtil.closeEL((OutputStream) obj);
	else if (obj instanceof Writer) IOUtil.closeEL((Writer) obj);
	else if (obj instanceof Reader) IOUtil.closeEL((Reader) obj);
	else if (obj instanceof Closeable) IOUtil.closeEL((Closeable) obj);
	else if (obj instanceof ZipFile) IOUtil.closeEL((ZipFile) obj);
	else if (obj instanceof ResultSet) IOUtil.closeEL((ResultSet) obj);
	else if (obj instanceof Connection) IOUtil.closeEL((Connection) obj);
	else {
	    try {
		Method method = obj.getClass().getMethod("close", new Class[0]);
		method.invoke(obj, new Object[0]);
	    }
	    catch (Throwable e) {
		ExceptionUtil.rethrowIfNecessary(e);
	    }
	}
    }
1348291
private static void close(Closeable closeable) {
		if (closeable != null) {
			try {
				closeable.close();
			} catch (IOException ignored) {
				logger.error("Failed to close output stream: "
						+ ignored.getMessage());
			}
		}
	}
366207
private function _closeEnd()
    {
        if ($this->name === 'blank') {
            return;
        }

        echo str_replace(':name', $this->realName, $this->brackets['close_end']);
        $this->doCallback('closed');
        if (!$this->hasOption('inline')) {
            if (!$this->inlineInner) {
                $this->closingComment();
            }
            if ($this->name !== 'blank') {
                Generator::lineBreak();
            }
        }
    }
946971
@Override
	public void endContentLine(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, int rowspan, boolean endsInternal) {
		out.print("    </td>\n"
				+ "  </tr>\n");
	}