Add peer_protocol.Integer.Int()
This commit is contained in:
parent
5b443fb63d
commit
380dc7a2b4
|
@ -19,6 +19,11 @@ func (i *Integer) Read(r io.Reader) error {
|
||||||
return binary.Read(r, binary.BigEndian, i)
|
return binary.Read(r, binary.BigEndian, i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// It's perfectly fine to cast these to an int.
|
||||||
|
func (i Integer) Int() int {
|
||||||
|
return int(i)
|
||||||
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Protocol = "\x13BitTorrent protocol"
|
Protocol = "\x13BitTorrent protocol"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue