Examples of writeBit()


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

 
  @Test
  public void pReadBigInteger_int() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
     
      for (NumWithInfo nwi : genNumWithInfos(128)) {
        stream.writeBigInteger(nwi.getNumber(), nwi.getNumber().bitLength() + 1);
      }
     
View Full Code Here

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

     
      for (NumWithInfo nwi : genNumWithInfos(128)) {
        stream.writeBigInteger(nwi.getNumber(), nwi.getNumber().bitLength() + 1);
      }
     
      stream.writeBit(1);
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(128)) {
        assertEquals(nwi.getNumber(), stream.readBigInteger(nwi.getNumber().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.readBigInteger(2);
      fail();
    } catch (InsufficientBufferException ex) {
    }
   
View Full Code Here

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

 
  @Test
  public void pReadFloat_void() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
     
      for (float sample : sampleFloats()) {
        stream.writeFloat(sample);
      }
     
View Full Code Here

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

     
      for (float sample : sampleFloats()) {
        stream.writeFloat(sample);
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (float sample : sampleFloats()) {
        assertEquals((double )sample, (double )stream.readFloat(), 0.00000001);
View Full Code Here

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

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

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

 
  @Test
  public void pReadDouble_void() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
     
      for (double sample : sampleDoubles()) {
        stream.writeDouble(sample);
      }
     
View Full Code Here

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

     
      for (double sample : sampleDoubles()) {
        stream.writeDouble(sample);
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (double sample : sampleDoubles()) {
        assertEquals(sample, stream.readDouble(), 0.00000001);
View Full Code Here

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

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

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

 
  @Test
  public void pReadBigDecimal_void() 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
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.