MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / RawGetV

Function RawGetV

Libraries/unrar/rawread.cpp:184–197  ·  view source on GitHub ↗

Read vint from arbitrary byte array.

Source from the content-addressed store, hash-verified

182
183// Read vint from arbitrary byte array.
184uint64 RawGetV(const byte *Data,uint &ReadPos,uint DataSize,bool &Overflow)
185{
186 Overflow=false;
187 uint64 Result=0;
188 for (uint Shift=0;ReadPos<DataSize;Shift+=7)
189 {
190 byte CurByte=Data[ReadPos++];
191 Result+=uint64(CurByte & 0x7f)<<Shift;
192 if ((CurByte & 0x80)==0)
193 return Result; // Decoded successfully.
194 }
195 Overflow=true;
196 return 0; // Out of buffer border.
197}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected