Example #1
0
func deserializeBytesSet(bytes []byte) (*set.SortedSet, error) {
	marshal, unmarshal := types.ByteSliceMarshals()
	m := &set.MSortedSet{MSorted: list.MSorted{MList: list.MList{MarshalItem: marshal, UnmarshalItem: unmarshal}}}
	err := m.UnmarshalBinary(bytes)
	if err != nil {
		return nil, err
	}
	return m.SortedSet(), nil
}
Example #2
0
func serializeBytesSet(s *set.SortedSet) ([]byte, error) {
	marshal, unmarshal := types.ByteSliceMarshals()
	m := set.NewMSortedSet(s, marshal, unmarshal)
	return m.MarshalBinary()
}