public void Shrink(uint rest) { if (rest > BaseStream.GetAvaliableByteCounts()) { Logger.WARN("rest {0} more upper than available {1} bytes", rest, BaseStream.GetAvaliableByteCounts()); rest = (uint)BaseStream.GetAvaliableByteCounts(); } BaseStream.SetLength(BaseStream.Position + rest); }
public IEnumerable <int> Bits() { var allbitscount = BaseStream.GetAvaliableByteCounts() * 8; for (int i = 0; i < allbitscount; i++) { if (_cursor == 8) { _cursor = 0; _currentByte = ReadByte(); } _cursor++; yield return((_currentByte >> 8 - (int)_cursor) & 1); } }