12345678910111213141516171819202122232425262728293031 |
-
- namespace SharpCompress.Compressors.Rar.UnpackV1
- {
- internal partial class Unpack
- {
- private uint SlotToLength(uint Slot)
- {
- //uint LBits,Length=2;
- int LBits;
- uint Length=2;
- if (Slot<8)
- {
- LBits=0;
- Length+=Slot;
- }
- else
- {
- //LBits=Slot/4-1;
- LBits=(int)(Slot/4-1);
- Length+=(4 | (Slot & 3)) << LBits;
- }
- if (LBits>0)
- {
- Length+=getbits()>>(16-LBits);
- AddBits(LBits);
- }
- return Length;
- }
- }
- }
|