// Write writes len(data) bytes to the object with key oid starting at byte
// offset offset. It returns an error, if any.
554556
func (ioctx *IOContext) Write(oid string, data []byte, offset uint64) error {
	c_oid := C.CString(oid)
	defer C.free(unsafe.Pointer(c_oid))

	dataPointer := unsafe.Pointer(nil)
	if len(data) > 0 {
		dataPointer = unsafe.Pointer(&data[0])
	}

	ret := C.rados_write(ioctx.ioctx, c_oid,
		(*C.char)(dataPointer),
		(C.size_t)(len(data)),
		(C.uint64_t)(offset))

	return GetRadosError(int(ret))
}
524383
func (w *LogWriter) Write(b []byte) (int, error) {
	return len(b), nil
}
885992
func (this *Writer) Write(p []byte) (n int, err error) {
	// write data into our internal buffer
	bytesRead, bytesWritten, err := this.converter.Convert(p, this.buffer[this.writePos:])

	// update bytes written for return
	n += bytesRead
	this.writePos += bytesWritten

	// checks for when we have a full buffer
	for this.writePos > 0 {
		// if we have an error, just return it
		if this.err != nil {
			return
		}

		// else empty the buffer
		this.emptyBuffer()
	}

	return n, err
}
302135
func (aw *Writer) Write(b []byte) (int, error) {
	if aw.closed {
		aw.err = ErrWriteAfterClose
		return 0, aw.err
	}
	var n int
	n, aw.err = aw.w.Write(b)
	if aw.err != nil {
		return n, aw.err
	}
	aw.nb -= int64(n)
	return n, aw.err
}
19446
func (w *Writer) Write(data []byte) (n int, err error) {
	// Do not print indentation if there is no data.
	indentBuf := indentationTabs
	if w.UseSpaces {
		indentBuf = indentationSpaces
	}

	for len(data) > 0 {
		var printUntil int
		endsWithNewLine := false

		lineBeginning := !w.insideLine
		if data[0] == '\n' && lineBeginning {
			// This is a blank line. Do not indent it, just print as is.
			printUntil = 1
		} else {
			if lineBeginning {
				// Print indentation.
				w.Writer.Write(indentBuf[:w.Level])
				w.insideLine = true
			}

			lineEnd := bytes.IndexRune(data, '\n')
			if lineEnd < 0 {
				// Print the whole thing.
				printUntil = len(data)
			} else {
				// Print until the newline inclusive.
				printUntil = lineEnd + 1
				endsWithNewLine = true
			}
		}
		toPrint := data[:printUntil]
		data = data[printUntil:]

		// Assertion: none of the runes in toPrint
		// can be newline except the last rune.
		// The last rune is newline iff endsWithNewLine==true.

		m, err := w.Writer.Write(toPrint)
		n += m

		if m == len(toPrint) && endsWithNewLine {
			// We've printed the newline, so we are the line beginning again.
			w.insideLine = false
		}
		if err != nil {
			return n, err
		}
	}
	return n, nil
}
854668
func (w *CountWriter) Write(b []byte) (n int, err error) {
	if n, err = w.W.Write(b); n > 0 {
		w.N += n
	}
	return
}
295158
func Write(w io.Writer, data ...interface{}) error {
	for _, v := range data {
		if err := binary.Write(w, binary.BigEndian, v); err != nil {
			return err
		}
	}

	return nil
}
65371
func (w *Writer) Write(b []byte) error {
	w.Lock()
	defer w.Unlock()

	// TODO(abg): Bounds check?
	binary.BigEndian.PutUint32(w.buff[:], uint32(len(b)))
	if _, err := w.w.Write(w.buff[:]); err != nil {
		return err
	}

	if len(b) == 0 {
		return nil
	}

	_, err := w.w.Write(b)
	return err
}
621372
func (e *encoder) Write(t int64) {
	e.ts = append(e.ts, uint64(t))
}
909751
func (w *WrapWriter) Write(p []byte) (n int, err error) {
	n, err = Wrap(w, p, w.off, w.wrapAt)
	w.off = (w.off + int64(n)) % w.wrapAt
	return n, err
}
253989
func (w *syncWriter) Write(p []byte) (n int, err error) {
	w.Lock()
	n, err = w.Writer.Write(p)
	w.Unlock()
	return n, err
}
451865
func (b *Buffer) Write(p []byte) (n int, err error) {

	for _, bbyte := range p {
		b.writebyte(bbyte)
	}
	return len(p), nil
}
253603
func (b ByteWriter) Write(data []byte) (int, error) {
	start := len(*b.buffer)
	size := len(data)
	capacity := cap(*b.buffer)

	if start+size > capacity {
		size := capacity - start
		*b.buffer = (*b.buffer)[:capacity]
		copy((*b.buffer)[start:], data[:size])
		return size, io.EOF
	}

	*b.buffer = (*b.buffer)[:start+size]
	copy((*b.buffer)[start:], data)

	return size, nil
}
1248380
func (w *minifyWriter) Write(b []byte) (int, error) {
	return w.pw.Write(b)
}
1201974
func (self *XXHash) Write(data []byte) (nn int, err error) {
	if data == nil {
		return 0, errors.New("Data cannot be nil.")
	}
	l := len(data)
	if l > 1<<30 {
		return 0, errors.New("Cannot add more than 1 Gigabytes at once.")
	}
	self.feed(data)
	return len(data), nil
}
76772
func (w *Writer) Write(record interface{}) error {
	m, ok := record.(map[string]string)
	if ok {
		return w.writeMapString(m)
	}
	return w.writeAny(reflect.ValueOf(record))
}
389481
func (c *C2) Write(b []byte) {
	c.a.Write(b)
	c.b.Write(b)
	c.lastWritten = len(b)
	c.totalWritten += c.lastWritten
}