DecodeString decodes a string from the given offset.
(size, offset uint)
| 293 | |
| 294 | // DecodeString decodes a string from the given offset. |
| 295 | func (d *DataDecoder) decodeString(size, offset uint) (string, uint, error) { |
| 296 | if offset+size > uint(len(d.buffer)) { |
| 297 | return "", 0, mmdberrors.NewOffsetError() |
| 298 | } |
| 299 | |
| 300 | newOffset := offset + size |
| 301 | value := d.stringCache.internAt(offset, size, d.buffer) |
| 302 | return value, newOffset, nil |
| 303 | } |
| 304 | |
| 305 | // DecodeUint16 decodes a 16-bit unsigned integer from the given offset. |
| 306 | func (d *DataDecoder) decodeUint16(size, offset uint) (uint16, uint, error) { |