Flush() 공개 메소드

public Flush ( ) : void
리턴 void
예제 #1
0
 void WriteNormalBits()
 {
     BitStringWriter writer = new BitStringWriter();
     for (int i = 0; i < m_bits.Count; i++)
     {
         writer.Write((uint)Math.Min((int)m_bits[i], MaxNormalValue), NormalBits);
     }
     writer.Flush();
     m_result.AddRange(writer.Bytes);
 }
예제 #2
0
 void WriteExceptionBits()
 {
     BitStringWriter writer = new BitStringWriter();
     for (int i = 0; i < m_bits.Count; i++)
     {
         if (m_bits[i] >= MaxNormalValue)
         {
             writer.Write((uint)((int)m_bits[i] - MaxNormalValue), ExceptionBits);
         }
     }
     writer.Flush();
     m_result.AddRange(writer.Bytes);
 }
예제 #3
0
        public void TestTwoBytesSplit()
        {
            BitStringWriter writer = new BitStringWriter();
            writer.Write(0, 3);
            writer.Write(1, 3);
            writer.Write(2, 3);
            writer.Write(3, 3);
            writer.Flush();

            byte[] expected = { unchecked((byte)-120), unchecked((byte)6) };
            byte[] actual = Base64.ByteEncoding.GetBytes(writer.Value);

            CollectionAssert.AreEqual(actual, expected);
        }
예제 #4
0
        public void TestOneByte()
        {
            BitStringWriter writer = new BitStringWriter();
            writer.Write(0, 2);
            writer.Write(1, 2);
            writer.Write(2, 2);
            writer.Write(3, 2);
            writer.Flush();

            byte[] expected = { unchecked((byte)-28) };
            byte[] actual = Base64.ByteEncoding.GetBytes(writer.Value);

            CollectionAssert.AreEqual(actual, expected);
        }