// Write to disk.
173459
func (ndb *nodeDB) Commit() {
	ndb.mtx.Lock()
	defer ndb.mtx.Unlock()

	ndb.batch.Write()
	ndb.batch.Close()
	ndb.batch = ndb.db.NewBatch()
}
190808
func (bufc *bufConn) Write(b []byte) (int, error) {
	return bufc.conn.Write(b)
}
860905
func (w *Writer) Write(data []byte) (n int, err error) {
	return w.d.write(data)
}
779064
func (c *Conn) Write(b []byte) (int, error) {
	n, err := c.fd.Write(b)
	if err != nil {
		return n, c.opError(opWrite, err)
	}

	return n, nil
}
1222710
func (c *Container) Write(bs []byte) (size int, err error) {
	for _, w := range c.ws {
		if size, err = w.Write(bs); err != nil {
			return
		}
	}

	return
}
1299342
func Write(path string) error {
	pid := os.Getpid()
	return write(path, pid)
}
324226
func (file *File) Write(buf []byte) (int, error) {
	n, err := file.WriteAt(buf, int64(file.offset))
	if err == nil {
		file.offset += uint64(n)
	}

	return n, err
}
844964
func (n *nopWriteCloser) Write(p []byte) (int, error) {
	return n.w.Write(p)
}
1044934
func (mBatch *cLevelDBBatch) Write() {
	err := mBatch.db.db.Write(mBatch.db.wo, mBatch.batch)
	if err != nil {
		panic(err)
	}
}
1185335
func (b *batch) Write() error {
	return b.db.Write(b.b, nil)
}
475009
func (file *fakeFile) Write(b []byte) (n int, err error) {
	return file.file.Write(b)
}
815444
func (c *CycleDB) Write(towrite []KvPair) error {
	atomic.AddInt64(&c.stats.TotalWriteCount, int64(len(towrite)))
	return c.db.Update(func(tx *bolt.Tx) error {
		bucket := tx.Bucket(c.bucketTimesIn)
		if bucket == nil {
			return errUnableToFindRootBucket
		}
		lastBucketKey, _ := bucket.Cursor().Last()
		if lastBucketKey == nil {
			return errNoLastBucket
		}
		lastBucket := bucket.Bucket(lastBucketKey)
		if lastBucket == nil {
			return errNoLastBucket
		}
		for _, p := range towrite {
			if err := lastBucket.Put(p.Key, p.Value); err != nil {
				return errors.Annotatef(err, "cannot put for key %v", p.Key)
			}
		}
		return nil
	})
}
300785
func (w *writer) Write(p []byte) (n int, err error) {
	n, err = w.fp.Write(p)
	w.digester.Hash().Write(p[:n])
	w.offset += int64(len(p))
	w.updatedAt = time.Now()
	return n, err
}
385024
func (w *wrapper) Write(b []byte) (int, error) {
	n, err := w.ResponseWriter.Write(b)
	w.written += n
	return n, err
}
286493
func (rw *Response) Write(buf []byte) (int, error) {
	if !rw.wroteHeader {
		rw.writeHeader(buf, "")
	}

	if !rw.firstByteSent {
		rw.firstByteSent = true
		rw.WaitBody()
	}

	if rw.body != nil {
		return rw.body.Write(buf)
	}

	return 0, errors.New("No storage")
}
32292
func (w *Writer) Write(buffer []byte) (n int, err error) {
	oldCount := w.count

	n = len(buffer)
	w.count += int64(n)

	if w.onWrite != nil {
		w.onWrite(w.count)
	}

	if w.writer != nil {
		n, err = w.writer.Write(buffer)
		w.count = oldCount + int64(n)
	}

	return
}
901515
func (l *LogFile) Write(b []byte) (int, error) {
	l.Lock()
	defer l.Unlock()
	return l.writer.Write(b)
}