public void SetRange(int bitIndex, int bitLength, BitBlock value) { for (int i = 0; i < bitLength; i++) { Bits[bitIndex + i] = value[i]; } }
public static uint Calculate32BitChecksum(BitBlock bits, int startIndex, int endIndex) { ulong sum = 0; for (int i = startIndex; i <= endIndex; i += 4) { sum += bits.GetUInt(i, 0, 32) & 0xFFFFFFFF; } return((uint)(sum & 0xFFFFFFFF)); }
public virtual async Task OpenFile(string filename, IFileSystem provider) { Filename = filename; CurrentFileSystem = provider; using (var f = new GenericFile()) { f.EnableInMemoryLoad = true; f.IsReadOnly = true; await f.OpenFile(filename, provider); Bits = new BitBlock(0); ProcessRawData(f); } }
public BitBlockFile(IEnumerable <byte> rawData) { Bits = new BitBlock(rawData); }
public BitBlockFile() { Bits = new BitBlock(0); }
public BitBlock(BitBlock source) { Position = 0; Bits = source.Bits.ToList(); // Clone the source }
public void SetNextRange(BitBlock value) { SetNextRange(value.Count, value); }
public void SetNextRange(int bitLength, BitBlock value) { SetRange(Position, bitLength, value); Position += bitLength; }
public void SetRange(int bitIndex, BitBlock value) { SetRange(bitIndex, value.Count, value); }