Examples of writeBit()


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)) {
        BigInteger mask = BigInteger.valueOf(2).pow(Long.SIZE).subtract(BigInteger.ONE);
View Full Code Here

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

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

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

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

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

     
      for (NumWithInfo nwi : genNumWithInfos(Long.SIZE)) {
        stream.writeLong(nwi.getNumber().longValue(), nwi.getBits());
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(Long.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.readLong(2);
      fail();
    } catch (InsufficientBufferException ex) {
    } finally {
    }
View Full Code Here

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

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

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

     
      for (NumWithInfo nwi : genNumWithInfos(Long.SIZE)) {
        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);
View Full Code Here

Examples of com.peterhi.runtime.BitStream.writeBit()

   
    {
      BitStream bs = new BitStream(1);
     
      for (int i = 0; i < 9; i++) {
        bs.writeBit(1);
      }
     
      assertEquals(9, bs.available());
      assertEquals(129, bs.bytes());
    }
View Full Code Here

Examples of javax.imageio.stream.ImageOutputStream.writeBit()

                    if (pos >= length) {
                        ios.reset();
                        ios.mark();
                        pos = 0;
                    }
                    ios.writeBit(0);
                    pos++;
                } while (--numReps >= 0);
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageOutputStream.writeBit()

                {
                    mcios.writeBits(image.getRGB(x, y) & 0xFF, bpc);
                }
                while (mcios.getBitOffset() != 0)
                {
                    mcios.writeBit(0);
                }
            }
            mcios.flush();
            mcios.close();
        }
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.