used by Integer as well
| 149 | |
| 150 | // used by Integer as well |
| 151 | word32 GetLength(Source& source) |
| 152 | { |
| 153 | word32 length = 0; |
| 154 | |
| 155 | byte b = source.next(); |
| 156 | if (b >= LONG_LENGTH) { |
| 157 | word32 bytes = b & 0x7F; |
| 158 | |
| 159 | if (source.IsLeft(bytes) == false) return 0; |
| 160 | |
| 161 | while (bytes--) { |
| 162 | b = source.next(); |
| 163 | length = (length << 8) | b; |
| 164 | } |
| 165 | } |
| 166 | else |
| 167 | length = b; |
| 168 | |
| 169 | if (source.IsLeft(length) == false) return 0; |
| 170 | |
| 171 | return length; |
| 172 | } |
| 173 | |
| 174 | |
| 175 | word32 SetLength(word32 length, byte* output) |
no test coverage detected