8 "github.com/pkg/errors"
12 // An alias for the underlying type of Integer. This is needed for fuzzing.
17 const IntegerMax = math.MaxUint32
19 func (i *Integer) UnmarshalBinary(b []byte) error {
21 return errors.New("expected 4 bytes")
23 *i = Integer(binary.BigEndian.Uint32(b))
27 func (i *Integer) Read(r io.Reader) error {
29 n, err := io.ReadFull(r, b[:])
34 return i.UnmarshalBinary(b[:])
39 // It's perfectly fine to cast these to an int. TODO: Or is it?
40 func (i Integer) Int() int {
44 func (i Integer) Uint64() uint64 {
48 func (i Integer) Uint32() uint32 {