Package com.peterhi.runtime

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


  @Test
  public void testConstructorBufOffLen() throws Exception {
    {
      BitStream bs = new BitStream(new byte[32], Byte.SIZE * 16, Byte.SIZE * 16);
      assertEquals(Byte.SIZE * 16, bs.available());
      assertEquals(16, bs.bytes());
    }
   
    try {
      BitStream bs = new BitStream(null, 0, 1);
      fail();
View Full Code Here


  @Test
  public void testAvailable() throws Exception {
    {
      BitStream bs = new BitStream(32);
      assertEquals(0, bs.available());
      assertEquals(32, bs.bytes());
    }
   
    {
      byte[] data = new byte[32];
      BitStream bs = new BitStream(data, 0, Byte.SIZE * data.length);
 
View Full Code Here

   
    {
      byte[] data = new byte[32];
      BitStream bs = new BitStream(data, 0, Byte.SIZE * data.length);
      assertEquals(Byte.SIZE * data.length, bs.available());
      assertEquals(data.length, bs.bytes());
    }
   
    {
      BitStream bs = new BitStream(32);
      bs.writeBit(1);
View Full Code Here

   
    {
      BitStream bs = new BitStream(32);
      bs.writeBit(1);
      assertEquals(1, bs.available());
      assertEquals(32, bs.bytes());
    }
  }
 
  @Test
  public void testSize() throws Exception {
View Full Code Here

  @Test
  public void testSize() throws Exception {
    {
      BitStream bs = new BitStream(32);
      assertEquals(0, bs.available());
      assertEquals(32, bs.bytes());
    }
   
    {
      byte[] data = new byte[32];
      BitStream bs = new BitStream(data, Byte.SIZE * 16, Byte.SIZE * 16);
 
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.