Package com.peterhi.runtime

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


 
  @Test
  public void testAlignRead() throws Exception {
    BitStream bs = new BitStream(new byte[] { 1, 1 }, 0, Byte.SIZE * 2);
    assertEquals(1, bs.readBit());
    bs.alignRead();
    assertEquals(1, bs.readBit());
    assertEquals(7, bs.available());
    assertEquals(2, bs.bytes());
  }
 
View Full Code Here


 
  @Test
  public void testClear() throws Exception {
    BitStream bs = new BitStream(2);
    bs.writeBit(1);
    bs.alignRead();
    bs.writeBit(0);
    bs.writeBit(1);
    assertEquals(1, bs.readBit());
    bs.clear();
    assertEquals(-1, bs.readBit());
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.