Package com.peterhi.obsolete

Examples of com.peterhi.obsolete.Stream.readUnsignedLong()


     
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(Long.SIZE)) {
        BigInteger mask = BigInteger.valueOf(2).pow(Long.SIZE).subtract(BigInteger.ONE);
        assertEquals(nwi.getNumber().and(mask), stream.readUnsignedLong());
      }
     
      assertEquals(1, stream.getData().readable());
    } finally {
    }
View Full Code Here


 
  @Test
  public void fReadUnsignedLong_void() throws Exception {
    try {
      Stream stream = new Stream();
      stream.readUnsignedLong();
      fail();
    } catch (EOFException ex) {
    } finally {
    }
   
View Full Code Here

    }
   
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
      stream.readUnsignedLong();
      fail();
    } catch (InsufficientBufferException ex) {
    } finally {
    }
   
View Full Code Here

    }
   
    try {
      Stream stream = new Stream();
      stream.write(new byte[7]);
      stream.readUnsignedLong();
      fail();
    } catch (InsufficientBufferException ex) {
    } finally {
    }
  }
View Full Code Here

      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(Long.SIZE)) {
        BigInteger mask = BigInteger.valueOf(2).pow(nwi.getBits()).subtract(BigInteger.ONE);
        BigInteger left = nwi.getNumber();
        BigInteger right = stream.readUnsignedLong(nwi.getBits());
       
        left = left.and(mask);
       
        assertEquals(left, right);
      }
View Full Code Here

 
  @Test
  public void fReadUnsignedLong_int() throws Exception {
    try {
      Stream stream = new Stream();
      stream.readUnsignedLong(1);
      fail();
    } catch (EOFException ex) {
    } finally {
    }
   
View Full Code Here

    }
   
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
      stream.readUnsignedLong(2);
      fail();
    } catch (InsufficientBufferException ex) {
    } finally {
    }
   
View Full Code Here

    }
   
    try {
      Stream stream = new Stream();
      stream.write(new byte[7]);
      stream.readUnsignedLong(64);
      fail();
    } catch (InsufficientBufferException ex) {
    } finally {
    }
  }
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.