// Finish writes out any remaining buffered input bytes (possibly zero bytes)
// as a short chunk. This should only be called once, and after that you can't
// use this encoder again.
773409
func (e *Encoder) Finish() []byte {
	if int64(len(e.buf)) >= e.plaintextChunkLen {
		panic("encoder buffer has more bytes than expected")
	}
	packet := e.sealOnePacket(int64(len(e.buf)))
	return packet
}
176866
func (rl *ReqLog) Finish(rle *ReqLogEntry) {
	rl.lock.Lock()
	defer rl.lock.Unlock()

	rle.Active = false
	rle.EndTime = time.Now()

	rl.maybeCleanup()
}
101448
func (t *ToTransformation) Finish(id execute.DatasetID, err error) {
	t.d.Finish(err)
}
416351
func (dec *Decoder) end() error {
	switch dec.curr.Kind() {
	case reflect.Struct:
		if err := dec.findStructField(); err != nil {
			return err
		}
	case reflect.Map:
		// leave backward compatibility for access to maps by .
		dec.traverseInMap(true)
	}
	return dec.decode()
}
131474
func (t *DryRunTarget) Finish(taskMap map[string]Task) error {
	return t.PrintReport(taskMap, t.out)
}
694778
func (s *WriterSender) Close() error {
	s.mu.Lock()
	defer s.mu.Unlock()

	if err := s.writer.Flush(); err != nil {
		return err
	}

	s.Send(message.NewBytesMessage(s.priority, bytes.TrimRightFunc(s.buffer.Bytes(), unicode.IsSpace)))
	s.buffer.Reset()
	s.writer.Reset(s.buffer)
	return nil
}
438019
func (w *Watcher) finish() {
	close(w.Fork)
	close(w.Exec)
	close(w.Exit)
	close(w.Error)
}
697533
func (i *Input) Close() error {
	if i.src != nil {
		if closer, ok := i.src.(io.Closer); ok {
			return closer.Close()
		}
	}
	return nil
}
834762
func (buf *Buffer) End() error {
	if buf.pos >= buf.size {
		return nil
	}

	buf.pos = buf.size
	return buf.Refresh()
}
185853
func (zr *Reader) finishBlock() {
	if zr.last {
		zr.rd.ReadPads()
		zr.err = io.EOF
	}
	zr.step = (*Reader).readBlockHeader
}
953568
func (b *buildGroup) finish(q *BuildQueue, buildStatus *buildStatus) {
	q.mutex.Lock()
	b.running--
	buildStatus.currentBuild = nil
	q.mutex.Unlock()

	q.waitingBuilders.Broadcast()
}
860313
func (w *Writer) Close() error {
	if err := w.checkLastByte(); err != nil {
		return err
	}

	return w.flush()
}
680249
func (w *SSTFileWriter) Finish() error {
	var cErr *C.char
	C.rocksdb_sstfilewriter_finish(w.c, &cErr)
	if cErr != nil {
		defer C.free(unsafe.Pointer(cErr))
		return errors.New(C.GoString(cErr))
	}
	return nil
}
1132517
func (w *writer) Close(err error) error {
	w.encoder.Flush()
	if err == nil {
		err = w.encoder.Error()
	}
	w.err = err
	if w.closer != nil {
		return w.closer.Close()
	} else {
		return nil
	}
}
876844
func (m *Meter) Finish() {
	if m == nil {
		return
	}

	m.update(false)
	close(m.updates)
}
384378
func (dec *Decoder) end() error {
	switch dec.curr.Kind() {
	case reflect.Struct:
		if err := dec.findStructField(); err != nil {
			return err
		}
	case reflect.Map:
		// leave backward compatibility for access to maps by .
		dec.walkInMap(dec.field)
	}
	if dec.value == "" {
		return nil
	}
	return dec.decode()
}
117127
func (e *Encoder) Flush() error {
	_, err := e.w.Write([]byte{'\n'})
	e.w.Flush()
	return err
}