]> Sergey Matveev's repositories - btrtrc.git/blob - bencode/bytes.go
Add bencode.Bytes
[btrtrc.git] / bencode / bytes.go
1 package bencode
2
3 type Bytes []byte
4
5 var (
6         _ Unmarshaler = &Bytes{}
7         _ Marshaler   = &Bytes{}
8 )
9
10 func (me *Bytes) UnmarshalBencode(b []byte) error {
11         *me = append([]byte(nil), b...)
12         return nil
13 }
14
15 func (me *Bytes) MarshalBencode() ([]byte, error) {
16         return *me, nil
17 }