(source *common.ZeroCopySource)
| 89 | return data, nil |
| 90 | } |
| 91 | func DecodeBool(source *common.ZeroCopySource) (bool, error) { |
| 92 | data, irregular, eof := source.NextBool() |
| 93 | if eof { |
| 94 | return false, io.ErrUnexpectedEOF |
| 95 | } |
| 96 | if irregular { |
| 97 | return false, common.ErrIrregularData |
| 98 | } |
| 99 | return data, nil |
| 100 | } |
| 101 | func DecodeString(source *common.ZeroCopySource) (string, error) { |
| 102 | data, _, irregular, eof := source.NextString() |
| 103 | if eof { |
no test coverage detected