// WriteMatrix writes an array of 5 bytes to set the LED matrix
167988
func (b *LEDDriver) WriteMatrix(data []byte) (err error) {
	err = b.adaptor().WriteCharacteristic(ledMatrixStateCharacteristic, data)
	return
}
1140908
func (s *InlineFNV64a) Write(data []byte) (int, error) {
	hash := uint64(*s)
	for _, c := range data {
		hash ^= uint64(c)
		hash *= prime64
	}
	*s = InlineFNV64a(hash)
	return len(data), nil
}
682076
func (m *Matrix) Set(row, col int, val float64) {
	index := (m.stride * row) + col
	m.elements[index] = val
}
215135
func (it *Iterator) Write(spec interface{}) int {
	return it.dt.Write(it.index, spec)
}
1185335
func (b *batch) Write() error {
	return b.db.Write(b.b, nil)
}
1014337
func writeMPIs(w io.Writer, mpis ...parsedMPI) (err error) {
	for _, mpi := range mpis {
		err = writeMPI(w, mpi.bitLength, mpi.bytes)
		if err != nil {
			return
		}
	}
	return
}
1248380
func (w *minifyWriter) Write(b []byte) (int, error) {
	return w.pw.Write(b)
}
1032015
func (t *http2Client) Write(s *Stream, hdr []byte, data []byte, opts *Options) error {
	if opts.Last {
		// If it's the last message, update stream state.
		if !s.compareAndSwapState(streamActive, streamWriteDone) {
			return errStreamDone
		}
	} else if s.getState() != streamActive {
		return errStreamDone
	}
	df := &dataFrame{
		streamID:  s.id,
		endStream: opts.Last,
	}
	if hdr != nil || data != nil { // If it's not an empty data frame.
		// Add some data to grpc message header so that we can equally
		// distribute bytes across frames.
		emptyLen := http2MaxFrameLen - len(hdr)
		if emptyLen > len(data) {
			emptyLen = len(data)
		}
		hdr = append(hdr, data[:emptyLen]...)
		data = data[emptyLen:]
		df.h, df.d = hdr, data
		// TODO(mmukhi): The above logic in this if can be moved to loopyWriter's data handler.
		if err := s.wq.get(int32(len(hdr) + len(data))); err != nil {
			return err
		}
	}
	return t.controlBuf.put(df)
}
178186
func genEncMatrix(d, p int) matrix {
	r := d + p
	m := make([]byte, r*d)
	// create identity matrix upper
	for i := 0; i < d; i++ {
		m[i*d+i] = byte(1)
	}
	// create cauchy matrix below
	off := d * d // offset of encMatrix
	for i := d; i < r; i++ {
		for j := 0; j < d; j++ {
			d := i ^ j
			a := inverseTbl[d]
			m[off] = byte(a)
			off++
		}
	}
	return m
}
670861
func (w *normWriter) Write(data []byte) (n int, err error) {
	// Process data in pieces to keep w.buf size bounded.
	const chunk = 4000

	for len(data) > 0 {
		// Normalize into w.buf.
		m := len(data)
		if m > chunk {
			m = chunk
		}
		w.rb.src = inputBytes(data[:m])
		w.rb.nsrc = m
		w.buf = doAppend(&w.rb, w.buf, 0)
		data = data[m:]
		n += m

		// Write out complete prefix, save remainder.
		// Note that lastBoundary looks back at most 31 runes.
		i := lastBoundary(&w.rb.f, w.buf)
		if i == -1 {
			i = 0
		}
		if i > 0 {
			if _, err = w.w.Write(w.buf[:i]); err != nil {
				break
			}
			bn := copy(w.buf, w.buf[i:])
			w.buf = w.buf[:bn]
		}
	}
	return n, err
}
464937
func (mw *MirrorWriter) Write(b []byte) (int, error) {
	mycopy := make([]byte, len(b))
	copy(mycopy, b)
	mw.msgSync <- mycopy
	return len(b), nil
}
825175
func writeAll(d []byte, w io.Writer) (err error) {
    i := 0
    n := 0
    l := len(d)
    for i < l && err != nil {
        n, err = w.Write(d[i:])
        i += n
    }
    return
}
801775
func (imd *IMDraw) SetMatrix(m pixel.Matrix) {
	imd.matrix = m
	imd.batch.SetMatrix(imd.matrix)
}
1363801
func (m *Matrix) Copy() *Matrix {
	r := &Matrix{m.list, m.dims, m.offsets}
	r.list = make([]complex128, len(m.list))
	copy(r.list, m.list)
	return r
}
101347
func (w *NonColorable) Write(data []byte) (n int, err error) {
	er := bytes.NewReader(data)
	var bw [1]byte
loop:
	for {
		c1, err := er.ReadByte()
		if err != nil {
			break loop
		}
		if c1 != 0x1b {
			bw[0] = c1
			w.out.Write(bw[:])
			continue
		}
		c2, err := er.ReadByte()
		if err != nil {
			break loop
		}
		if c2 != 0x5b {
			continue
		}

		var buf bytes.Buffer
		for {
			c, err := er.ReadByte()
			if err != nil {
				break loop
			}
			if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' {
				break
			}
			buf.Write([]byte(string(c)))
		}
	}

	return len(data), nil
}
551935
func (mi MetaInfo) Write(w io.Writer) error {
	return bencode.NewEncoder(w).Encode(mi)
}
837034
func (table *SimpleTable) Write(w io.Writer) (err error) {
	_, err = w.Write([]byte(formatRow(table.headers, table.columnWidths)))
	if err != nil {
		return
	}
	for _, row := range table.rows {
		_, err = w.Write([]byte(formatRow(row, table.columnWidths)))
		if err != nil {
			return
		}
	}
	return
}