StringWithLength unmarshals a string of a given length (for non-null terminated strings)
(len int)
| 158 | // StringWithLength unmarshals a string of a given length (for non-null |
| 159 | // terminated strings) |
| 160 | func (a *AlignedBuff) StringWithLength(len int) (string, error) { |
| 161 | v := binaryutil.String(a.data[a.pos : a.pos+len]) |
| 162 | a.pos += len |
| 163 | return v, nil |
| 164 | } |
| 165 | |
| 166 | // Uint unmarshals an uint in native endianess and alignment for the C "unsigned |
| 167 | // int" type. It returns ErrEOF when trying to read beyond the payload. Please |