Examples of writeBit()


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

 
  @Test
  public void pReadInt_int() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
     
      for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) {
        stream.writeInt(nwi.getNumber().intValue(), nwi.getBits());
      }
     
View Full Code Here

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

     
      for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) {
        stream.writeInt(nwi.getNumber().intValue(), nwi.getBits());
      }
     
      stream.writeBit(1);
     
      stream.readBit();

      for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) {
        if (nwi.isNormal()) {
View Full Code Here

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

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

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

 
  @Test
  public void pReadUnsignedInt_int() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
     
      for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) {
        stream.writeInt(nwi.getNumber().intValue(), nwi.getBits());
      }
     
View Full Code Here

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

     
      for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) {
        stream.writeInt(nwi.getNumber().intValue(), nwi.getBits());
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) {
        BigInteger mask = BigInteger.valueOf(2).pow(nwi.getBits()).subtract(BigInteger.ONE);
View Full Code Here

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

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

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

  @Test
  public void pReadLong_void() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
     
      for (NumWithInfo nwi : genNumWithInfos(Long.SIZE)) {
        stream.writeLong(nwi.getNumber().longValue());
      }
     
View Full Code Here

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

     
      for (NumWithInfo nwi : genNumWithInfos(Long.SIZE)) {
        stream.writeLong(nwi.getNumber().longValue());
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(Long.SIZE)) {
        assertEquals(nwi.getNumber().longValue(), stream.readLong());
View Full Code Here

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

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

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

 
  @Test
  public void pReadUnsignedLong_void() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
     
      for (NumWithInfo nwi : genNumWithInfos(Long.SIZE)) {
        stream.writeLong(nwi.getNumber().longValue());
      }
     
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.