Package com.peterhi.obsolete

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


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


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

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

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

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

     
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) {
        long mask = 0xffffffffL;
        assertEquals(nwi.getNumber().longValue() & mask, stream.readUnsignedInt());
      }
     
      assertEquals(1, stream.getData().readable());
    } finally {
    }
View Full Code Here

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

    }
   
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
      stream.readUnsignedInt();
      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.