(data []byte)
| 86 | } |
| 87 | |
| 88 | func (d *packedLengthFieldDescriptor) parseValue(data []byte) ( |
| 89 | value interface{}, |
| 90 | remaining []byte, |
| 91 | err error) { |
| 92 | |
| 93 | sizeBytes, remaining, err := readSlice(data, d.packedLength) |
| 94 | if err != nil { |
| 95 | return nil, nil, err |
| 96 | } |
| 97 | |
| 98 | size := bytesToLEUint(sizeBytes) |
| 99 | |
| 100 | // NOTE: slice and long blob don't work well together. In particular, |
| 101 | // the largest slice is 2GB (because the len intrinsic returns an int), |
| 102 | // while the largest long blob is 4GB. |
| 103 | if size > uint64(math.MaxInt32) { |
| 104 | return nil, nil, errors.Newf("Blob too large: %d", size) |
| 105 | } |
| 106 | |
| 107 | return readSlice(remaining, int(size)) |
| 108 | } |
| 109 | |
| 110 | // |
| 111 | // stringFieldDescriptor ----------------------------------------------------- |
no test coverage detected