YTSFlix_Go/vendor/github.com/anacrolix/torrent/bencode/bytes.go

19 lines
291 B
Go
Raw Normal View History

2018-11-04 14:58:15 +00:00
package bencode
type Bytes []byte
var (
_ Unmarshaler = &Bytes{}
_ Marshaler = &Bytes{}
_ Marshaler = Bytes{}
)
func (me *Bytes) UnmarshalBencode(b []byte) error {
*me = append([]byte(nil), b...)
return nil
}
func (me Bytes) MarshalBencode() ([]byte, error) {
return me, nil
}