// AddByte appends all 8 bits of the given byte to the end of the list
979736
func (bl *BitList) AddByte(b byte) {
	for i := 7; i >= 0; i-- {
		bl.AddBit(((b >> uint(i)) & 1) == 1)
	}
}
1207742
func (b *Builder) addUInt(v uint64) {
	if v <= 9 {
		b.buf.WriteByte(0x30 + byte(v))
	} else {
		b.appendUInt(v, 0x27)
	}
}
756044
func addBytesParts(ctx context.Context, bs blobserver.StatReceiver, dst *[]BytesPart, spans []span, parent *uploadBytesFuture) {
	for _, sp := range spans {
		if len(sp.children) == 1 && sp.children[0].isSingleBlob() {
			// Remove an occasional useless indirection of
			// what would become a bytes schema blob
			// pointing to a single blobref.  Just promote
			// the blobref child instead.
			child := sp.children[0]
			*dst = append(*dst, BytesPart{
				BlobRef: child.br,
				Size:    uint64(child.size()),
			})
			sp.children = nil
		}
		if len(sp.children) > 0 {
			childrenSize := int64(0)
			for _, cs := range sp.children {
				childrenSize += cs.size()
			}
			future := uploadBytes(ctx, bs, newBytes(), childrenSize, sp.children)
			parent.children = append(parent.children, future)
			*dst = append(*dst, BytesPart{
				BytesRef: future.BlobRef(),
				Size:     uint64(childrenSize),
			})
		}
		if sp.from == sp.to {
			panic("Shouldn't happen. " + fmt.Sprintf("weird span with same from & to: %#v", sp))
		}
		*dst = append(*dst, BytesPart{
			BlobRef: sp.br,
			Size:    uint64(sp.to - sp.from),
		})
	}
}
397616
func (b *Buffer) WriteByte(c byte) error {
	m := b.grow(1)
	b.buf[m] = c
	return nil
}
452236
func (b *Bitset) AppendByte(value byte, numBits int) {
	b.ensureCapacity(numBits)

	if numBits > 8 {
		log.Panicf("numBits %d out of range 0-8", numBits)
	}

	for i := numBits - 1; i >= 0; i-- {
		if value&(1<<uint(i)) != 0 {
			b.bits[b.numBits/8] |= 0x80 >> uint(b.numBits%8)
		}

		b.numBits++
	}
}
745928
func uint32Bytes(i uint32) []byte {
	bytes := make([]byte, 4)
	binary.BigEndian.PutUint32(bytes, i)
	return bytes
}
189207
func (h *Plus) Add(v []byte) {
	x := h.hash(v)
	if h.sparse {
		h.tmpSet.add(h.encodeHash(x))

		if uint32(len(h.tmpSet))*100 > h.m {
			h.mergeSparse()
			if uint32(h.sparseList.Len()) > h.m {
				h.toNormal()
			}
		}
	} else {
		i := bextr(x, 64-h.p, h.p) // {x63,...,x64-p}
		w := x<<h.p | 1<<(h.p-1)   // {x63-p,...,x0}

		rho := uint8(bits.LeadingZeros64(w)) + 1
		if rho > h.denseList[i] {
			h.denseList[i] = rho
		}
	}
}
1234188
func (b *Box) AddBytes(path string, t []byte) error {
	m := map[string]file.File{}
	f, err := file.NewFile(path, t)
	if err != nil {
		return err
	}
	m[resolver.Key(path)] = f
	res := resolver.NewInMemory(m)
	b.SetResolver(path, res)
	return nil
}
451836
func (c *CountingWriter) WriteByte(b byte) error {
	// If our underlying Writer is a ByteWriter, use its WriteByte directly.
	if bw, ok := c.Writer.(io.ByteWriter); ok {
		if err := bw.WriteByte(b); err != nil {
			return err
		}
		c.Count++
		return nil
	}

	c.singleByteBuf[0] = b
	_, err := c.Write(c.singleByteBuf[:])
	return err
}
734529
func (out *RAMOutputStream) WriteByte(b byte) error {
	if out.bufferPosition == out.bufferLength {
		out.currentBufferIndex++
		out.switchCurrentBuffer()
	}
	if out.crc != nil {
		out.crc.Write([]byte{b})
	}
	out.currentBuffer[out.bufferPosition] = b
	out.bufferPosition++
	return nil
}
375425
func (b *BitWriter) WriteByte(byt byte) error {

	// fill up b.b with b.count bits from byt
	b.b[0] |= byt >> (8 - b.count)

	if n, err := b.w.Write(b.b[:]); n != 1 || err != nil {
		return err
	}
	b.b[0] = byt << b.count

	return nil
}
386465
func (c *Chunk) AppendBytes(colIdx int, b []byte) {
	c.columns[colIdx].appendBytes(b)
}
446023
func (u *ubiTweak) addBytesProcessed(value int) {
    const len = 3
    carry := uint64(value)

    var words [len]uint64

    words[0] = u.tweak[0] & 0xffffffff
    words[1] = (u.tweak[0] >> 32) & 0xffffffff
    words[2] = u.tweak[1] & 0xffffffff

    for i := 0; i < len; i++ {
        carry += words[i]
        words[i] = carry
        carry >>= 32
    }
    u.tweak[0] = words[0] & 0xffffffff
    u.tweak[0] |= (words[1] & 0xffffffff) << 32
    u.tweak[1] |= words[2] & 0xffffffff
}
388419
func (b *ByteBuf) WriteByte(v byte) error {
	b.Expansion(1)
	b.buf[b.writerIndex] = v
	b.writerIndex++
	return nil
}
153102
func (r *Encoder) EncodeBytes(b []byte) error {
	if len(b) < STR_FIXED_COUNT {
		_, err := r.w.Write([]byte{byte(STR_FIXED_START + len(b))})
		if err != nil {
			return err
		}
		_, err = r.w.Write(b)
		return err
	}

	prefix := []byte(fmt.Sprintf("%d:", len(b)))

	_, err := r.w.Write(prefix)
	if err != nil {
		return err
	}

	_, err = r.w.Write(b)
	return err
}
408214
func (e *Encoder) AddBE(src interface{}) error {
	e.WrittenBytes += binary.Size(src)
	return binary.Write(e.w, binary.BigEndian, src)
}
100418
func (dd *dictDecoder) writeByte(c byte) {
	dd.hist[dd.wrPos] = c
	dd.wrPos++
}