Examples of writeBit()


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

     
      for (BigDecimal number : numbers) {
        stream.writeBigDecimal(number);
      }
     
      stream.writeBit(1);
     
      stream.readBit();

      for (BigDecimal number : numbers) {
        assertEquals(number, stream.readBigDecimal());
View Full Code Here

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

    } catch (EOFException ex) {
    }

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

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

 
  @Test
  public void pReadBigDecimal_int() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
     
      List<BigDecimal> numbers = new ArrayList<BigDecimal>();
     
      for (NumWithInfo nwi : genNumWithInfos(128)) {
        BigInteger unscaled = nwi.getNumber();
View Full Code Here

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

     
      for (BigDecimal number : numbers) {
        stream.writeBigDecimal(number, number.unscaledValue().bitLength() + 1);
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (BigDecimal number : numbers) {
        assertEquals(number, stream.readBigDecimal(number.unscaledValue().bitLength() + 1));
View Full Code Here

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

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

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

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

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

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

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

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

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

  public void pReadLine_void() throws Exception {
    try {
      String template = "Hello World!";
      String text = "Hello World!\nHello World!\rHello World!\n\rHello World!\nHello World!\n";
      Stream stream = new Stream();
      stream.writeBit(1);
      stream.write(text.getBytes(Charset.forName("ascii")));
      stream.writeBit(1);
     
      stream.readBit();
     
View Full Code Here

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

      String template = "Hello World!";
      String text = "Hello World!\nHello World!\rHello World!\n\rHello World!\nHello World!\n";
      Stream stream = new Stream();
      stream.writeBit(1);
      stream.write(text.getBytes(Charset.forName("ascii")));
      stream.writeBit(1);
     
      stream.readBit();
     
      for (int i = 0; i < 5; i++) {
        assertEquals(template, stream.readLine());
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.