Package com.peterhi.obsolete

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


        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


        stream.writeLong(nwi.getNumber().longValue());
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(Long.SIZE)) {
        BigInteger mask = BigInteger.valueOf(2).pow(Long.SIZE).subtract(BigInteger.ONE);
        assertEquals(nwi.getNumber().and(mask), stream.readUnsignedLong());
      }
View Full Code Here

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

        stream.writeLong(nwi.getNumber().longValue(), nwi.getBits());
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(Long.SIZE)) {
        BigInteger mask = BigInteger.valueOf(2).pow(nwi.getBits()).subtract(BigInteger.ONE);
        BigInteger left = nwi.getNumber();
        BigInteger right = stream.readUnsignedLong(nwi.getBits());
View Full Code Here

        stream.writeVarLong(nwi.getNumber().longValue());
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(max)) {
        if (nwi.getBits() < max) {
          if (nwi.isOverflow() || nwi.isUnderflow()) {
            continue;
View Full Code Here

      Stream stream = new Stream();
      stream.writeBit(1);
      stream.write(sampleBytes());
      stream.writeBit(1);
     
      stream.readBit();
     
      for (int i = 0; i < sampleBytes().length; i++) {
        assertEquals(sampleBytes()[i], stream.readByte());
      }
     
View Full Code Here

      Stream stream = new Stream();
      stream.writeBit(1);
      stream.write(sampleBytes());
      stream.writeBit(1);
     
      stream.readBit();
     
      for (int i = 0; i < sampleBytes().length; i++) {
        assertEquals(sampleBytes()[i] & 0xff, stream.readUnsignedByte());
      }
     
View Full Code Here

        stream.writeShort(sh);
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (int i = 0; i < sampleShorts().length; i++) {
        assertEquals(sampleShorts()[i], stream.readShort());
      }
     
View Full Code Here

        stream.writeShort(sh);
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (int i = 0; i < sampleShorts().length; i++) {
        assertEquals(sampleShorts()[i] & 0xffff, stream.readUnsignedShort());
      }
     
View Full Code Here

        stream.writeChar(ch);
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (int i = 0; i < sampleChars().length; i++) {
        assertEquals(sampleChars()[i], stream.readChar());
      }
     
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.