7 "github.com/pkg/errors"
12 func (i *Integer) UnmarshalBinary(b []byte) error {
14 return errors.New("expected 4 bytes")
16 *i = Integer(binary.BigEndian.Uint32(b))
20 func (i *Integer) Read(r io.Reader) error {
22 n, err := r.Read(b[:])
24 return i.UnmarshalBinary(b[:])
27 return io.ErrUnexpectedEOF
32 // It's perfectly fine to cast these to an int. TODO: Or is it?
33 func (i Integer) Int() int {
37 func (i Integer) Uint64() uint64 {
41 func (i Integer) Uint32() uint32 {