ReadString
(copy bool)
| 958 | |
| 959 | // ReadString |
| 960 | func (p *BinaryProtocol) ReadString(copy bool) (value string, err error) { |
| 961 | bytes, n, all := protowire.BinaryDecoder{}.DecodeBytes((p.Buf)[p.Read:]) |
| 962 | if n < 0 { |
| 963 | return "", errDecodeField |
| 964 | } |
| 965 | if copy { |
| 966 | value = string(bytes) |
| 967 | } else { |
| 968 | v := (*rt.GoString)(unsafe.Pointer(&value)) |
| 969 | v.Ptr = rt.IndexPtr(*(*unsafe.Pointer)(unsafe.Pointer(&p.Buf)), byteTypeSize, p.Read+n) |
| 970 | v.Len = int(all - n) |
| 971 | } |
| 972 | _, err = p.next(all) |
| 973 | return |
| 974 | } |
| 975 | |
| 976 | // ReadEnum |
| 977 | func (p *BinaryProtocol) ReadEnum() (proto.EnumNumber, error) { |
no test coverage detected