mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-22 15:04:43 +00:00
rar5: checkin missing file
This commit is contained in:
36
src/SharpCompress/Compressors/Rar/UnpackInline.cs
Normal file
36
src/SharpCompress/Compressors/Rar/UnpackInline.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SharpCompress.Compressors.Rar
|
||||
{
|
||||
internal partial class Unpack
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user