Package com.peterhi.runtime

Examples of com.peterhi.runtime.BitStream.writeBit()


  @Test
  public void testSkipWrite() throws Exception {
    BitStream bs0 = new BitStream(1);
    bs0.writeBit(1);
    bs0.alignWrite();
    bs0.writeBit(1);
    BitStream bs1 = new BitStream(1);
    bs1.writeBit(1);
    bs1.skipWrite(7);
    bs1.writeBit(1);
    byte[] data = new byte[] { 1, 1 };
View Full Code Here


    BitStream bs0 = new BitStream(1);
    bs0.writeBit(1);
    bs0.alignWrite();
    bs0.writeBit(1);
    BitStream bs1 = new BitStream(1);
    bs1.writeBit(1);
    bs1.skipWrite(7);
    bs1.writeBit(1);
    byte[] data = new byte[] { 1, 1 };
    assertArrayEquals(data, bs0.toByteArray());
    assertArrayEquals(data, bs1.toByteArray());
View Full Code Here

    bs0.alignWrite();
    bs0.writeBit(1);
    BitStream bs1 = new BitStream(1);
    bs1.writeBit(1);
    bs1.skipWrite(7);
    bs1.writeBit(1);
    byte[] data = new byte[] { 1, 1 };
    assertArrayEquals(data, bs0.toByteArray());
    assertArrayEquals(data, bs1.toByteArray());
   
    try {
View Full Code Here

      assertEquals(data.length, bs.bytes());
    }
   
    {
      BitStream bs = new BitStream(32);
      bs.writeBit(1);
      assertEquals(1, bs.available());
      assertEquals(32, bs.bytes());
    }
  }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.