Package com.peterhi.obsolete

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


     
      stream.writeBit(1);
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(128)) {
        assertEquals(nwi.getNumber(), stream.readBigInteger());
      }
     
      assertEquals(1, stream.getData().readable());
    } finally {
    }
View Full Code Here


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

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

    }
   
    try {
      Stream stream = new Stream();
      stream.getData().fill(1, 17);
      stream.readBigInteger();
      fail();
    } catch (InsufficientBufferException ex) {
    }
  }
 
View Full Code Here

     
      stream.writeBit(1);
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(128)) {
        assertEquals(nwi.getNumber(), stream.readBigInteger(nwi.getNumber().bitLength() + 1));
      }
     
      assertEquals(BigInteger.ZERO, stream.readBigInteger(0));
     
      assertEquals(1, stream.getData().readable());
View Full Code Here

     
      for (NumWithInfo nwi : genNumWithInfos(128)) {
        assertEquals(nwi.getNumber(), stream.readBigInteger(nwi.getNumber().bitLength() + 1));
      }
     
      assertEquals(BigInteger.ZERO, stream.readBigInteger(0));
     
      assertEquals(1, stream.getData().readable());
    } finally {
    }
  }
View Full Code Here

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

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

    }
   
    try {
      Stream stream = new Stream();
      stream.getData().fill(1, 100);
      stream.readBigInteger(101);
      fail();
    } catch (InsufficientBufferException ex) {
    }
  }
 
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.