// WriteUint to the writer
189195
func (w *Writer) WriteUint(i uint64) {
	if i <= 9 {
		w.writeByte(byte('0' + i))
		return
	}
	if i <= math.MaxInt32 {
		w.writeByte(TagInteger)
	} else {
		w.writeByte(TagLong)
	}
	var buf [20]byte
	w.write(util.GetUintBytes(buf[:], i))
	w.writeByte(TagSemicolon)
}
840214
func randUint(n int) []uint64 {
	s := make([]uint64, n)

	// Fill the array the user gave us but make sure there aren't any zeros.
	for i := 0; i < n; i++ {
		s[i] = randomNonZero()
	}

	return s
}
27313
func (s *cryptoStreamImpl) Write(p []byte) (int, error) {
	s.writeBuf = append(s.writeBuf, p...)
	return len(p), nil
}
463423
func (b *ByteBuf) WriteUInt64(v uint64) (n int, err error) {
	b.Expansion(8)
	Uint64ToBytesTo(v, b.buf[b.writerIndex:b.writerIndex+8])
	b.writerIndex += 8
	return 8, nil
}
991969
func (ctx *Context) QueryUint(key string, defaults ...uint) uint {
	return (*Queries)(ctx.req).MustUint(key, defaults...)
}
794326
func (w *stdWriter) Write(p []byte) (n int, err error) {
	if w == nil || w.Writer == nil {
		return 0, errors.New("Writer not instantiated")
	}
	if p == nil {
		return 0, nil
	}

	header := [stdWriterPrefixLen]byte{stdWriterFdIndex: w.prefix}
	binary.BigEndian.PutUint32(header[stdWriterSizeIndex:], uint32(len(p)))
	buf := bufPool.Get().(*bytes.Buffer)
	buf.Write(header[:])
	buf.Write(p)

	n, err = w.Writer.Write(buf.Bytes())
	n -= stdWriterPrefixLen
	if n < 0 {
		n = 0
	}

	buf.Reset()
	bufPool.Put(buf)
	return
}
321269
func writeUint16To(w io.Writer, v uint16, n *int64) error {
	var buf [2]byte
	binary.BigEndian.PutUint16(buf[:], v)
	nn, err := w.Write(buf[:])
	*n += int64(nn)
	return err
}
1275516
func (s *Streamer) SendUint(id, event string, data uint64) {
	const maxUintToStrLen = 20

	p := format(id, event, maxUintToStrLen)
	p = strconv.AppendUint(p[:len(p)-(maxUintToStrLen+2)], data, 10)

	// Re-add \n\n at the end
	p = p[:len(p)+2]
	p[len(p)-2] = '\n'
	p[len(p)-1] = '\n'

	s.event <- p
}
442499
func (vb *packer) WriteUint16(num uint16) (int, error) {
	binary.BigEndian.PutUint16(vb.tempBuffer[:2], num)
	vb.Write(vb.tempBuffer[:2])
	return 2, nil
}
1066383
func WriteInt32(w io.Writer, val int32) (n int, err error) {
	return WriteUint32(w, uint32(val))
}
141122
func (ed *eventData) writeUint32(value uint32) {
	binary.Write(&ed.buffer, binary.LittleEndian, value)
}
696765
func Hex2Uint(str string) (uint64, error) {
	if len(str) > 2 {
		if head := str[:2]; head == "0x" || head == "0X" {
			str = str[2:]
		}
	}

	var n uint64
	for _, c := range str {
		if c >= '0' && c <= '9' {
			c = c - '0'
		} else if c >= 'a' && c <= 'f' {
			c = c - 'a' + 10
		} else if c >= 'A' && c <= 'F' {
			c = c - 'A' + 10
		} else {
			return 0, errors.Newf("Invalid hexadecimal string %s", str)
		}
		n = n << 4
		n |= uint64(c)
	}

	return n, nil
}
1267590
func asUint(param string) uint64 {

	i, err := strconv.ParseUint(param, 0, 64)
	panicIf(err)

	return i
}
479607
func (vb *packer) WriteUint32(num uint32) (int, error) {
	binary.BigEndian.PutUint32(vb.tempBuffer[:4], num)
	vb.Write(vb.tempBuffer[:4])
	return 4, nil
}
682835
func randomUint64(r io.Reader) (uint64, error) {
	rv, err := binarySerializer.Uint64(r, bigEndian)
	if err != nil {
		return 0, err
	}
	return rv, nil
}
712918
func (tr Row) ForceUint64(nn int) (val uint64) {
	val, _ = tr.Uint64Err(nn)
	return
}
513299
func MustUint(input interface{}) uint64 {
	output, err := Uint(input)
	if err != nil {
		panic(err)
	}
	return output
}