// Flush finishes writing the current file (optional).
429435
func (tw *Writer) Flush() error {
	if tw.nb > 0 {
		tw.err = fmt.Errorf("archive/tar: missed writing %d bytes", tw.nb)
		return tw.err
	}

	n := tw.nb + tw.pad
	for n > 0 && tw.err == nil {
		nr := n
		if nr > blockSize {
			nr = blockSize
		}
		var nw int
		nw, tw.err = tw.w.Write(zeroBlock[0:nr])
		n -= int64(nw)
	}
	tw.nb = 0
	tw.pad = 0
	return tw.err
}
993591
func (o *ioOutput) Flush() error {
	if w, ok := o.writer.(flushWriter); ok {
		return w.Flush()
	}
	if w, ok := o.writer.(syncWriter); ok {
		return w.Sync()
	}
	return nil
}
26850
func (r *Rx) Flush() {
	if r.head == r.tail {
		return
	}
	r.p.writeAtomic(r.tail, slotFree|slotToPayloadSize(r.head-r.tail))
	r.tail = r.head
}
291110
func (c *Client) Flush() error {
	if c == nil {
		return fmt.Errorf("Client is nil")
	}
	c.Lock()
	defer c.Unlock()
	return c.flushLocked()
}
373870
func (w *WindowsWriter) Flush() error {
	_, err := w.out.Write(w.buffer)
	if err != nil {
		return err
	}
	w.buffer = []byte{}
	return nil
}
631940
func (log *logCache) Flush(writer io.Writer) {
	log.flushing.Lock()
	defer log.flushing.Unlock()

	for _, message := range log.messages {
		writer.Write(message)
	}
	log.messages = [][]byte{}
}
1265688
func (w *responseWriter) Flush() {
	if w, ok := w.ResponseWriter.(http.Flusher); ok {
		w.Flush()
	}
}
1128310
func (w *LogWriter) Flush() error {
	w.bufferLock.Lock()
	defer w.bufferLock.Unlock()

	var err error
	if len(w.buffer) > 0 {
		err = w.send(w.buffer)
		w.buffer = []byte{}
	}

	return err
}
1284994
func (i *Handle) Flush() error {
	_, err := i.doCmdWithoutAttr(ipvsCmdFlush)
	return err
}
279391
func (r *responseWriter) Flush() {
	if f, ok := r.ResponseWriter.(http.Flusher); ok {
		f.Flush()
	}
}
1090660
func (w *responseWriter) Flush() {
	if flusher, ok := w.Flusher(); ok {
		flusher.Flush()
	}
}
865079
func (w *Writer) Flush() error {
	if w.buf.Len() == 0 {
		return nil
	}

	if err := w.clearLines(); err != nil {
		return err
	}
	w.lines = countLines(w.buf.String())

	if _, err := w.w.Write(w.buf.Bytes()); err != nil {
		return err
	}

	w.buf.Reset()
	return nil
}
129627
func (ctx *hookContext) Flush(process string, ctxErr error) (err error) {
	return ctx.recorder.Close()
}
57567
func (ix *IndexWriter) Flush() {
	ix.addName("")

	var off [5]uint32
	ix.main.writeString(magic)
	off[0] = ix.main.offset()
	for _, p := range ix.paths {
		ix.main.writeString(p)
		ix.main.writeString("\x00")
	}
	ix.main.writeString("\x00")
	off[1] = ix.main.offset()
	copyFile(ix.main, ix.nameData)
	off[2] = ix.main.offset()
	ix.mergePost(ix.main)
	off[3] = ix.main.offset()
	copyFile(ix.main, ix.nameIndex)
	off[4] = ix.main.offset()
	copyFile(ix.main, ix.postIndex)
	for _, v := range off {
		ix.main.writeUint32(v)
	}
	ix.main.writeString(trailerMagic)

	os.Remove(ix.nameData.name)
	for _, f := range ix.postFile {
		os.Remove(f.Name())
	}
	os.Remove(ix.nameIndex.name)
	os.Remove(ix.postIndex.name)

	log.Printf("%d data bytes, %d index bytes", ix.totalBytes, ix.main.offset())

	ix.main.flush()
}
525898
func Flush(ctx context.Context) {
	if r, ok := FromContext(ctx); ok {
		if f, ok := r.(flusher); ok {
			f.Flush()
		}
	}
}
871606
func (w *Writer) Flush() error {
	w.Lock()
	defer w.Unlock()

	events := w.events.drain()

	// No events to flush.
	if len(events) == 0 {
		return nil
	}

	w.err = w.flush(events)
	return w.err
}
250719
func (pw *Writer) Flush() (int64, error) {
	if pw.numBits < 8 && pw.cntBuf == 0 {
		return pw.Offset, nil
	}
	if _, err := pw.PushBits(); err != nil {
		return pw.Offset, err
	}
	cnt, err := pw.wr.Write(pw.buf[:pw.cntBuf])
	pw.cntBuf -= cnt
	pw.Offset += int64(cnt)
	return pw.Offset, err
}