// ReadInt get int value from buf
196170
func (b *ByteBuf) ReadInt() (int, error) {
	if b.Readable() < 4 {
		return 0, io.ErrShortBuffer
	}

	b.readerIndex += 4
	return Byte2Int(b.buf[b.readerIndex-4 : b.readerIndex]), nil
}
48544
func (iter *Iterator) ReadUint() uint {
	if strconv.IntSize == 32 {
		return uint(iter.ReadUint32())
	}
	return uint(iter.ReadUint64())
}
931074
func ReadBits(bigint *big.Int, buf []byte) {
	i := len(buf)
	for _, d := range bigint.Bits() {
		for j := 0; j < wordBytes && i > 0; j++ {
			i--
			buf[i] = byte(d)
			d >>= 8
		}
	}
}
1298450
func (v *Value) StoreInt(i int) {
	*v = Value{t: reflect.Int, i: i}
}
1228337
func (r *Store) GetInt(key string) (int, error) {
	v := r.GetEntry(key)
	if v == nil {
		return 0, fmt.Errorf(errFindParse, "int", key)
	}
	return v.IntDefault(-1)
}
909163
func readInt32(rd io.Reader) (int32, error) {
	var i int32
	if err := binary.Read(rd, binary.LittleEndian, &i); err != nil {
		return 0, err
	}
	return i, nil
}
559878
func (b *buf) Int() int64 {
	ux, bits := b.Varint()
	x := int64(ux)
	if x&(1<<(bits-1)) != 0 {
		x |= -1 << bits
	}
	return x
}
1048830
func (file *File) Readn(buf []byte, offset uint64) (int, error) {
	ret := 0
	for len(buf) > 0 {
		n, err := file.ReadAt(buf, int64(offset))
		if err != nil {
			return 0, err
		}

		if n == 0 {
			break
		}

		buf = buf[n:]
		offset += uint64(n)
		ret += n
	}

	return ret, nil
}
108011
func (c *CountingReader) Read(buf []byte) (int, error) {
	amount, err := c.Reader.Read(buf)
	c.Count += int64(amount)
	return amount, err
}
502231
func ReadInt64(file string) (int64, error) {
	f, err := os.Open(file)
	if err != nil {
		return 0, err
	}
	defer f.Close()

	buf := make([]byte, 19)
	n, err := f.Read(buf)
	if err != nil {
		return 0, err
	}

	p := strings.Split(string(buf[0:n]), "\n")
	v, err := strconv.ParseInt(p[0], 10, 64)
	if err != nil {
		return 0, err
	}

	return v, nil
}
473510
func (iter *Iterator) ReadInt8() (ret int8) {
	c := iter.nextToken()
	if c == '-' {
		val := iter.readUint32(iter.readByte())
		if val > math.MaxInt8+1 {
			iter.ReportError("ReadInt8", "overflow: "+strconv.FormatInt(int64(val), 10))
			return
		}
		return -int8(val)
	}
	val := iter.readUint32(c)
	if val > math.MaxInt8 {
		iter.ReportError("ReadInt8", "overflow: "+strconv.FormatInt(int64(val), 10))
		return
	}
	return int8(val)
}
628806
func (r *reader) readVarInt32() int32 {
	ux := r.readVarUint32()
	x := int32(ux >> 1)
	if ux&1 != 0 {
		x = ^x
	}
	return x
}
833244
func Int(v interface{}, err error) (int64, error) {
	if err != nil {
		return 0, err
	}
	vi, ok := v.(int64)
	if ok {
		return vi, nil
	}

	vbi, ok := v.(*big.Int)
	if ok {
		if vbi.BitLen() <= 63 {
			return vbi.Int64(), nil
		}
	}

	return 0, newWrongTypeError(v, vi)

}
355857
func (c *ConfigParser) Getint(section, option string) (val int, err error) {
	sv, err := c.Get(section, option)
	if err != nil {
		return val, err
	}
	return strconv.Atoi(sv)
}
818587
func FromInt(data [4]byte) int {
	ui32 := binary.LittleEndian.Uint32(data[:])
	return int(ui32)
}
1079674
func (m *Manager) GetInt(key string) int {
	return cast.ToInt(m.Get(key))
}
911787
func (r *Reader) toInt(input string) int {
	result, err := strconv.Atoi(prune(input))
	if err != nil {
		return -1
	}
	return result
}