Examples of alignWrite()


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

 
  @Test
  public void testAlignWrite() throws Exception {
    BitStream bs = new BitStream(2);
    bs.writeBit(1);
    bs.alignWrite();
    bs.writeBit(1);
    byte[] data = bs.toByteArray();
    assertEquals(1, data[0]);
    assertEquals(1, data[1]);
    assertEquals(9, bs.available());
View Full Code Here

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

 
  @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);
View Full Code Here

Examples of com.peterhi.runtime.Buffer.alignWrite()

   
    // 00000000 0000000[1]
    testBuffer.write(1);
   
    // 00000000 [00000001]
    assertEquals(7, testBuffer.alignWrite());
   
    // 00000000 [00000001]
    assertEquals(0, testBuffer.alignWrite());
   
    // 0000000[1 00000001]
View Full Code Here

Examples of com.peterhi.runtime.Buffer.alignWrite()

   
    // 00000000 [00000001]
    assertEquals(7, testBuffer.alignWrite());
   
    // 00000000 [00000001]
    assertEquals(0, testBuffer.alignWrite());
   
    // 0000000[1 00000001]
    testBuffer.write(1);
   
    // 0000000[1 0000000]1
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.