Ejemplo n.º 1
0
 public IEnumerable <bool> ReadBits(int nBits)
 {
     for (int i = 0; i < nBits; i++)
     {
         if (ByteSwitcher.NextDouble() < SecondStreamProportion)
         {
             yield return(BitStream2.ReadSequentialBit());
         }
         else
         {
             yield return(BitStream1.ReadSequentialBit());
         }
     }
     BitStream1.ToNextByte();
     BitStream2.ToNextByte();
 }
Ejemplo n.º 2
0
 public void AdvanceBitPointer(int positions)
 {
     for (int i = 0; i < positions; i++)
     {
         if (ByteSwitcher.NextDouble() < SecondStreamProportion)
         {
             BitStream2.AdvanceBitPointer(1);
         }
         else
         {
             BitStream1.AdvanceBitPointer(1);
         }
     }
     BitStream1.ToNextByte();
     BitStream2.ToNextByte();
 }
Ejemplo n.º 3
0
 public void ToNextByte()
 {
     BitStream1.ToNextByte();
     BitStream2.ToNextByte();
 }
Ejemplo n.º 4
0
 public bool ReadSequentialBit()
 {
     return(ByteSwitcher.NextDouble() < SecondStreamProportion
         ? BitStream2.ReadSequentialBit()
         : BitStream1.ReadSequentialBit());
 }