// Flush encodes a flush-pkt to the output stream.
483841
func (e *Encoder) Flush() error {
	_, err := e.w.Write(FlushPkt)
	return err
}
196076
func Flush(c context.Context) error {
	return GetState(c).Flush(c, nil)
}
27315
func flush(r io.Reader) (bytes int64, err error) {
	return io.Copy(ioutil.Discard, r)
}
1213555
func (aw *Writer) Flush() error {
	if aw.nb > 0 {
		aw.err = fmt.Errorf("ar: missed writing %d bytes", aw.nb)
		return aw.err
	}
	if !aw.arFileHeaderWritten {
		_, aw.err = aw.w.Write([]byte(ArFileHeader))
		if aw.err != nil {
			return aw.err
		}
		aw.arFileHeaderWritten = true
	}
	if aw.pad {
		//pad with a newline
		if _, aw.err = aw.w.Write([]byte("\n")); aw.err != nil {
			return aw.err
		}
	}
	aw.nb = 0
	aw.pad = false
	return aw.err
}
1090660
func (w *responseWriter) Flush() {
	if flusher, ok := w.Flusher(); ok {
		flusher.Flush()
	}
}
279391
func (r *responseWriter) Flush() {
	if f, ok := r.ResponseWriter.(http.Flusher); ok {
		f.Flush()
	}
}
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)
}
256330
func (c *PostgresCacher) Flush() error {
	_, err := c.c.Exec("DELETE FROM cache")
	return err
}
149220
func (e *BoundaryWriter) Flush() error {
	if e.buffered == "" {
		return nil
	}
	if n, err := e.Target.Write([]byte(e.buffered)); err != nil || n != len(e.buffered) {
		return err
	}
	e.buffered = ""
	return nil
}
291110
func (c *Client) Flush() error {
	if c == nil {
		return fmt.Errorf("Client is nil")
	}
	c.Lock()
	defer c.Unlock()
	return c.flushLocked()
}
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
}
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
}
550667
func (w *PosixWriter) Flush() error {
	l := len(w.buffer)
	offset := 0
	retry := 0
	for {
		n, err := syscall.Write(w.fd, w.buffer[offset:])
		if err != nil {
			if retry < flushMaxRetryCount {
				retry++
				continue
			}
			return err
		}
		offset += n
		if offset == l {
			break
		}
	}
	w.buffer = []byte{}
	return nil
}
688199
func (p *BulkProcessor) Flush() error {
	p.statsMu.Lock()
	p.stats.Flushed++
	p.statsMu.Unlock()

	for _, w := range p.workers {
		w.flushC <- struct{}{}
		<-w.flushAckC // wait for completion
	}
	return nil
}
387793
func (b *BitWriter) Flush(bit Bit) error {

	for b.count != 8 {
		err := b.WriteBit(bit)
		if err != nil {
			return err
		}
	}

	return nil
}
954002
func (e Encoder) flush() error {
	length := e.buf.Len()
	if length > 0 {
		if err := binary.Write(e.w, binary.BigEndian, uint16(length)); err != nil {
			return errors.Wrap(err, "An error occured writing length bytes during flush")
		}

		if _, err := e.buf.WriteTo(e.w); err != nil {
			return errors.Wrap(err, "An error occured writing message bytes during flush")
		}
	}

	_, err := e.w.Write(EndMessage)
	if err != nil {
		return errors.Wrap(err, "An error occurred ending encoding message")
	}
	e.buf.Reset()

	return nil
}
1162943
func (rw *responseWriter) Flush() {
	if f, ok := rw.ResponseWriter.(http.Flusher); ok {
		f.Flush()
	}
}