// Flush writes any buffered data to the underlying io.Writer.
// It sends the frame with "fin" flag set to true.
//
// If no Write() or ReadFrom() was made, then Flush() does nothing.
969795
func (w *Writer) Flush() error {
	if (!w.dirty && w.Buffered() == 0) || w.err != nil {
		return w.err
	}

	w.err = w.flushFragment(true)
	w.n = 0
	w.dirty = false
	w.fragmented = false

	return w.err
}
647494
func flush(emitter *yaml_emitter_t) bool {
	if emitter.buffer_pos+5 >= len(emitter.buffer) {
		return yaml_emitter_flush(emitter)
	}
	return true
}
217517
func (w *Writer) Flush() (int, error) {
	defer func() {
		w.mux.Unlock()
	}()
	w.mux.Lock()

	if len(w.chunk) > 0 {
		// lines are containing newline, chunk may not
		chunk := w.chunk
		w.chunk = nil
		w.store = append(w.store, chunk)
	}

	// we only need to care about the full matches in the remaining lines
	// (no more lines were come, why care about the partial matches?)
	matchMap, _ := w.matchSecrets(w.store)
	redactedLines := w.redact(w.store, matchMap)
	w.store = nil

	return w.writer.Write(bytes.Join(redactedLines, nil))
}
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
}
483841
func (e *Encoder) Flush() error {
	_, err := e.w.Write(FlushPkt)
	return err
}
1326128
func (c *conn) Flush() error {
	c.mu.Lock()
	defer c.mu.Unlock()
	return c.buf.Flush()
}
394827
func (fw *flushWriter) Write(p []byte) (n int, err error) {
	n, err = fw.w.Write(p)
	if fw.f != nil {
		fw.f.Flush()
	}
	return
}
390038
func (s *BufferedSender) flush(b *bytes.Buffer) (int, error) {
	bb := b.Bytes()
	bbl := len(bb)
	if bb[bbl-1] == '\n' {
		bb = bb[:bbl-1]
	}
	//n, err := s.sender.Send(bytes.TrimSuffix(b.Bytes(), []byte("\n")))
	n, err := s.sender.Send(bb)
	b.Truncate(0) // clear the buffer
	return n, err
}
373870
func (w *WindowsWriter) Flush() error {
	_, err := w.out.Write(w.buffer)
	if err != nil {
		return err
	}
	w.buffer = []byte{}
	return nil
}
1331256
func (w *PktlineWriter) Flush() error {
	if w == nil {
		return nil
	}

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

	if err := w.pl.writeFlush(); err != nil {
		return err
	}

	return nil
}
622915
func (w *writerWithoutCloseNotify) Flush() {
	if f, ok := w.W.(http.Flusher); ok {
		f.Flush()
	}
}
809953
func (s *IndicesForcemergeService) Flush(flush bool) *IndicesForcemergeService {
	s.flush = &flush
	return s
}
628192
func (bw *BufferedFileWriter) Flush() {
	bw.mu.Lock()
	// could add check if bw.done already
	//  should never happen
	bw.bufWriter.Flush()
	bw.origWriter.f.Sync()
	bw.mu.Unlock()
}
1143762
func (bg *Writer) Flush() error {
	if bg.closed {
		return ErrClosed
	}
	if err := bg.Error(); err != nil {
		return err
	}

	if bg.active.next == 0 {
		return nil
	}

	var c *compressor
	c, bg.active = bg.active, <-bg.waiting
	bg.queue <- c
	bg.qwg.Add(1)
	go c.writeBlock()

	return bg.Error()
}
27315
func flush(r io.Reader) (bytes int64, err error) {
	return io.Copy(ioutil.Discard, r)
}
10148
func (s *Stream) Flush() (error) {
	var err C.int
	_ = C.pa_simple_flush(s.simple, &err)
	if err == C.PA_OK {
		return nil
	}
	return errorFromCode(err)
}
1318001
func (d *pcXTDriver) Flush() error {
	defer func() {
		d.buffer = nil
	}()
	sc, err := chunkScanCodes(d.buffer, d.scancodeChunkSize)
	if err != nil {
		return err
	}
	for _, b := range sc {
		if err := d.sendImpl(b); err != nil {
			return err
		}
		time.Sleep(d.interval)
	}
	return nil
}