Files
xgcl/utils/encoding/marshaler.go
T
2026-05-27 23:03:00 +08:00

17 lines
524 B
Go

package encoding
// encoding 定义gcl中用到的marshaler
type UtilMarshaler interface {
// MarshalUtil append the marshaled data to data and return the appended data.
// The input data coulde be nil. If any error happens, returned []byte is the
// same as input data. The returned []byte may be re-allocate memory.
MarshalUtil(data []byte) ([]byte, error)
}
type UtilUnmarshaler interface {
// UnmarshalUtil unmarshal from data, and return the total consumed bytes.
UnmarshalUtil(data []byte) (uint64, error)
}