End the document, close any open element, and flush the output stream.
426472
public ISynchronizationPoint<IOException> end() {
		while (!context.isEmpty())
			closeElement();
		ISynchronizationPoint<IOException> write = writer.flush();
		if (!write.isUnblocked()) {
			SynchronizationPoint<IOException> sp = new SynchronizationPoint<>();
			write.listenInline(() -> { output.flush().listenInline(sp); }, sp);
			return sp;
		}
		if (write.hasError())
			return write;
		return output.flush();
	}
699411
@Override
    public void close()
            throws IOException
    {
        if (closed) {
            return;
        }
        try {
            flush();
            out.close();
        }
        finally {
            closed = true;
            inputBufferAllocator.release(inputBuffer);
            outputBufferAllocator.release(outputBuffer);
            inputBuffer = null;
            outputBuffer = null;
        }
    }
1169999
public void endDocument() throws IOException {
		// close all unclosed tag;
		while (depth > 0) {
			endTag(elNamespace[depth], elName[depth]);
		}
		// assert depth == 0;
		// assert startTagIncomplete == false;
		finished = pastRoot = startTagIncomplete = true;
		out.flush();
	}
368107
@Override
    public final void close() {
        dispose();

        if (this.outputWriter != null) {
            try {
                this.outputWriter.close();
            } catch (IOException ioe) {
                logger.error("Unable to close output stream.", ioe);
            } finally {
                this.outputWriter = null;
            }
        }
    }
31087
def close(self):
        
        if self.read_option('save_pointer'):
            self._update_last_pointer()
        super(S3Writer, self).close()
961153
public void endChunk () {
		flush();
		if (TRACE) trace("kryo", "End chunk.");
		try {
			getOutputStream().write(0); // Zero length chunk.
		} catch (IOException ex) {
			throw new KryoException(ex);
		}
	}
668035
def close_fileoutput (self):
        
        if self.fd is not None:
            try:
                self.flush()
            except IOError:
                # ignore flush errors
                pass
            if self.close_fd:
                try:
                    self.fd.close()
                except IOError:
                    # ignore close errors
                    pass
            self.fd = None
1255052
def close(self):
        
        if self._closed:
            return
        self._closed = True
        self._writer.endElementNS((namespaces.xmlstream, "stream"), None)
        for prefix in self._nsmap_to_use:
            self._writer.endPrefixMapping(prefix)
        self._writer.endDocument()
        del self._writer
352466
function close()
    {
        /*
         * If there are still lines waiting to be written, open the output
         * window so that we can drain the buffer.
         */
        if (!$this->_opened && (count($this->_buffer) > 0)) {
            $this->open();
        }

        if ($this->_opened) {
            $this->_writeln('</table>');
            $this->_writeln('</body></html>');
            $this->_drainBuffer();
            $this->_opened = false;
        }

        return ($this->_opened === false);
    }
931513
def close(self):
        
        if self.closed:
            return

        if self.mode in "aw":
            self.fileobj.write(NUL * (BLOCKSIZE * 2))
            self.offset += (BLOCKSIZE * 2)
            # fill up the end with zero-blocks
            # (like option -b20 for tar does)
            blocks, remainder = divmod(self.offset, RECORDSIZE)
            if remainder > 0:
                self.fileobj.write(NUL * (RECORDSIZE - remainder))

        if not self._extfileobj:
            self.fileobj.close()
        self.closed = True
553347
def end_document implicit_end = !streaming?
      @last.implicit_end = implicit_end
      n = pop
      set_end_location(n)
      n
    end
724121
public void finish() {
        for (Map.Entry<String, String> entry : posTags.entrySet()) {
            posWriter.println(entry.getKey() + " " + entry.getValue());
        }
        posWriter.flush();
        posWriter.close();

        writer.flush();
        writer.close();
    }
109804
def close(self):
        """"""
        self.fire(JSONStreamer.DOC_END_EVENT)
        self._stack = None
        self._parser.close()
1305487
public void endMethod() throws IOException {
    Scope popped = popScope();
    if (popped == Scope.NON_ABSTRACT_METHOD) {
      indent();
      out.write("}\n");
    } else if (popped != Scope.ABSTRACT_METHOD) {
      throw new IllegalStateException();
    }
  }
1302909
def end_output (self, **kwargs):
        """"""
        self.xml_endtag(u"graph")
        self.xml_endtag(u"GraphXML")
        self.xml_end_output()
        self.close_fileoutput()
633475
public function stream_close()
    {
        $this->stream_flush();
        fclose($this->fd);
        $this->path = null;
        $this->fd = null;
    }
176375
public void endDocument() throws ODataRenderException {

        try {
            xmlWriter.writeEndDocument();
            xmlWriter.flush();
        } catch (XMLStreamException e) {
            LOG.error("Not possible to end stream XML");
            throw new ODataRenderException("Not possible to end stream XML: ", e);
        }
    }