/** * Closes the output buffer. */ public void close() { _state |= OutputModule.PHP_OUTPUT_HANDLER_END; if (!callCallback()) { // all data that has and ever will be written has now been processed _state = 0; doFlush(); } WriteStream @out = _out; _out = null; TempStream tempStream = _tempStream; _tempStream = null; try { if (@out != null) { @out.close(); } } catch (IOException e) { log.log(Level.FINER, e.ToString(), e); } if (tempStream != null) { tempStream.destroy(); } }
/** * Returns the result as a string. */ public Value get_buffer(Env env) { TempStream ts = _tempStream; _tempStream = null; if (ts == null) { return(BooleanValue.FALSE); } StringValue result = env.createBinaryBuilder(); for (TempBuffer ptr = ts.getHead(); ptr != null; ptr = ptr.getNext()) { result.append(ptr.getBuffer(), 0, ptr.getLength()); } ts.destroy(); return(result); }
public void writeToStream(WriteStream os) { _tempStream.writeToStream(os); _tempStream.destroy(); }