// writeSetTo writes an item as a single DEL record to the a bufio Writer.
423038
func (dbi *dbItem) writeDeleteTo(buf []byte) []byte {
	buf = appendArray(buf, 2)
	buf = appendBulkString(buf, "del")
	buf = appendBulkString(buf, dbi.key)
	return buf
}
789195
func (dec *declaration) writeParamTo(w io.Writer, name string, params map[string]string) (int64, error) {
	if s, ok := params[name]; ok {
		if strings.HasPrefix(s, dollarMark) {
			if v, ok := dec.Context().vars[strings.TrimPrefix(s, dollarMark)]; ok {
				return v.WriteTo(w)
			}
			return 0, nil
		}

		n, err := w.Write([]byte(s))
		return int64(n), err
	}

	if v, ok := dec.Context().vars[name]; ok {
		return v.WriteTo(w)
	}

	return 0, nil
}
639078
func (db *DB) Delete(doc *Doc) error {
	if doc.ID == 0 {
		return fmt.Errorf("doc never written")
	}

	tx, err := db.meta.Begin()
	if err != nil {
		return err
	}
	defer tx.Rollback() // no-op after Commit

	if err := db.store.Delete(tx, doc); err != nil {
		return err
	}
	txt := text{ID: doc.ID}
	if err := db.store.Delete(tx, &txt); err != nil {
		return err
	}

	err = tx.Commit()
	if err != nil {
		return err
	}

	return nil
}
844964
func (n *nopWriteCloser) Write(p []byte) (int, error) {
	return n.w.Write(p)
}
1347276
func (b *Base) WriteBody(qq422016 qtio422016.Writer) {
	//line base.qtpl:36
	qw422016 := qt422016.AcquireWriter(qq422016)
	//line base.qtpl:36
	b.StreamBody(qw422016)
	//line base.qtpl:36
	qt422016.ReleaseWriter(qw422016)
//line base.qtpl:36

}
41607
func (w *Writer) WriteSlice(slice []reflect.Value) {
	setWriterRef(w, nil, nil)
	count := len(slice)
	if count == 0 {
		writeEmptyList(w)
		return
	}
	writeListHeader(w, count)
	for i := range slice {
		w.WriteValue(slice[i])
	}
	writeListFooter(w)
}
1133332
func WriteTemplate(qq422016 qtio422016.Writer, p Partial) {
	
	qw422016 := qt422016.AcquireWriter(qq422016)
	
	StreamTemplate(qw422016, p)
	
	qt422016.ReleaseWriter(qw422016)


}
58055
func (p *PortStatus) WriteTo(w io.Writer) (int64, error) {
	return encoding.WriteTo(w, p.Reason, pad7{}, &p.Port)
}
1056851
func (cd service) Write(thing interface{}, transId string) error {

	o := thing.(organisation)
	props := constructOrganisationProperties(o)

	deleteEntityRelationshipsQuery := constructDeleteEntityRelationshipQuery(o.UUID)
	resetOrgQuery := constructResetOrganisationQuery(o.UUID, props)

	queries := []*neoism.CypherQuery{deleteEntityRelationshipsQuery, resetOrgQuery}

	//add type
	err, stringType := o.Type.String()
	if err == nil {
		setTypeStatement := fmt.Sprintf(`MERGE (o:Thing {uuid: {uuid}})  set o : %s `, stringType)
		setTypeQuery := &neoism.CypherQuery{
			Statement: setTypeStatement,
			Parameters: map[string]interface{}{
				"uuid": o.UUID,
			},
		}
		queries = append(queries, setTypeQuery)

	} else {
		return err
	}

	mergingQueriesForOldNodes, err := cd.constructMergingOldOrganisationNodesQueries(o.UUID, o.AlternativeIdentifiers.UUIDS)
	if err != nil {
		return err
	}

	if len(mergingQueriesForOldNodes) != 0 {
		queries = append(queries, mergingQueriesForOldNodes...)
	}

	//ADD all the IDENTIFIER nodes and IDENTIFIES relationships
	for _, alternativeUUID := range o.AlternativeIdentifiers.TME {
		alternativeIdentifierQuery := createNewIdentifierQuery(o.UUID, tmeIdentifierLabel, alternativeUUID)
		queries = append(queries, alternativeIdentifierQuery)
	}

	for _, alternativeUUID := range o.AlternativeIdentifiers.UUIDS {
		alternativeIdentifierQuery := createNewIdentifierQuery(o.UUID, uppIdentifierLabel, alternativeUUID)
		queries = append(queries, alternativeIdentifierQuery)
	}

	if o.AlternativeIdentifiers.FactsetIdentifier != "" {
		queries = append(queries, createNewIdentifierQuery(o.UUID, factsetIdentifierLabel, o.AlternativeIdentifiers.FactsetIdentifier))
	}

	if o.AlternativeIdentifiers.LeiCode != "" {
		queries = append(queries, createNewIdentifierQuery(o.UUID, leiIdentifierLabel, o.AlternativeIdentifiers.LeiCode))
	}

	if o.IndustryClassification != "" {
		industryClassQuery := constructCreateIndustryClassificationQuery(o.UUID, o.IndustryClassification)
		queries = append(queries, industryClassQuery)
	}

	if o.ParentOrganisation != "" {
		parentQuery := constructCreateParentOrganisationQuery(o.UUID, o.ParentOrganisation)
		queries = append(queries, parentQuery)
	}
	return cd.conn.CypherBatch(queries)
}
406353
func WritePageTemplate(qq422016 qtio422016.Writer, p Page) {
	
	qw422016 := qt422016.AcquireWriter(qq422016)
	
	StreamPageTemplate(qw422016, p)
	
	qt422016.ReleaseWriter(qw422016)

}
244601
func (w *Writer) Write(p []byte) (nRet int, errRet error) {
	if w.ibuf == nil {
		// Do not buffer incoming bytes. This does not perform or compress well
		// if the caller of Writer.Write writes many small slices. This
		// behavior is therefore deprecated, but still supported for backwards
		// compatibility with code that doesn't explicitly Flush or Close.
		return w.write(p)
	}

	// The remainder of this method is based on bufio.Writer.Write from the
	// standard library.

	for len(p) > (cap(w.ibuf)-len(w.ibuf)) && w.err == nil {
		var n int
		if len(w.ibuf) == 0 {
			// Large write, empty buffer.
			// Write directly from p to avoid copy.
			n, _ = w.write(p)
		} else {
			n = copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p)
			w.ibuf = w.ibuf[:len(w.ibuf)+n]
			w.Flush()
		}
		nRet += n
		p = p[n:]
	}
	if w.err != nil {
		return nRet, w.err
	}
	n := copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p)
	w.ibuf = w.ibuf[:len(w.ibuf)+n]
	nRet += n
	return nRet, nil
}
383798
func (b *batch) Write() error {
	b.db.lock.Lock()
	defer b.db.lock.Unlock()

	for _, keyvalue := range b.writes {
		if keyvalue.delete {
			delete(b.db.db, string(keyvalue.key))
			continue
		}
		b.db.db[string(keyvalue.key)] = keyvalue.value
	}
	return nil
}
954820
func writeServiceDocFile(g *generateInfo) error {
	return writeGoFile(filepath.Join(g.PackageDir, "doc.go"),
		codeLayout,
		strings.TrimSpace(g.API.ServicePackageDoc()),
		g.API.PackageName(),
		"",
	)
}
422905
func (d *DirectPinDriver) ServoWrite(level byte) (err error) {
	if writer, ok := d.Connection().(ServoWriter); ok {
		return writer.ServoWrite(d.Pin(), level)
	}
	err = ErrServoWriteUnsupported
	return
}
995273
func (r Record) WriteTo(w io.Writer) (int64, error) {
	n, err := fmt.Fprintf(w, "%s\t%s\n", r.IP, r.Hosts)
	return int64(n), err
}
561787
func DigitalWrite(key interface{}, val int) error {
	pin, err := NewDigitalPin(key)
	if err != nil {
		return err
	}

	return pin.Write(val)
}
894293
func (c *connectedUDPConn) WriteTo(b []byte, addr net.Addr) (int, error) {
	writer, ok := c.PacketConn.(io.Writer)
	if ok {
		return writer.Write(b)
	}
	return c.PacketConn.WriteTo(b, addr)
}