(r io.ByteReader, count uint64)
| 143 | } |
| 144 | |
| 145 | func readOptionalBool(r io.ByteReader, count uint64) ([]bool, error) { |
| 146 | if err := checkUint64(count, true); err != nil { |
| 147 | return nil, err |
| 148 | } |
| 149 | |
| 150 | all, err := r.ReadByte() |
| 151 | if err != nil { |
| 152 | return nil, fmt.Errorf("readOptionalBool: ReadByte error: %w", err) |
| 153 | } |
| 154 | |
| 155 | if all == 0 { |
| 156 | return readBool(r, count) |
| 157 | } |
| 158 | |
| 159 | defined := make([]bool, count) |
| 160 | for i := range defined { |
| 161 | defined[i] = true |
| 162 | } |
| 163 | |
| 164 | return defined, nil |
| 165 | } |
| 166 | |
| 167 | func readSizes(r io.ByteReader, count uint64) ([]uint64, error) { |
| 168 | if err := checkUint64(count, true); err != nil { |
no test coverage detected
searching dependent graphs…