Package com.peterhi.obsolete

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


     
      for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) {
        stream.writeInt(nwi.getNumber().intValue());
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) {
        assertEquals(nwi.getNumber().intValue(), stream.readInt());
View Full Code Here


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

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

     
      for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) {
        stream.writeInt(nwi.getNumber().intValue());
      }
     
      stream.writeBit(1);
     
      stream.readBit();
     
      for (NumWithInfo nwi : genNumWithInfos(Integer.SIZE)) {
        long mask = 0xffffffffL;
View Full Code Here

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

      for (int i = 0; i < sampleBytes().length; i++) {
        sample[i] = sampleBytes()[i] & 0xff;
      }

      Stream stream = new Stream();
      stream.writeBit(1);
      stream.write(sampleBytes());

      stream.readBit();
     
      for (int i = 0; i < sample.length; i++) {
View Full Code Here

 
  @Test
  public void fRead_void() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
      stream.read();
      fail();
    } catch (InsufficientBufferException ex) {
    }
  }
View Full Code Here

 
  @Test
  public void pRead_byteArray() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
      stream.write(sampleBytes());
      stream.writeBit(1);
      stream.write(sampleBytes());

      byte[] sample = new byte[sampleBytes().length];
View Full Code Here

  public void pRead_byteArray() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
      stream.write(sampleBytes());
      stream.writeBit(1);
      stream.write(sampleBytes());

      byte[] sample = new byte[sampleBytes().length];
      stream.readBit();
      assertEquals(sampleBytes().length, stream.read(sample));
View Full Code Here

    }
   
    try {
      Stream stream = new Stream();
      stream.write(1);
      stream.writeBit(1);
      byte[] sample = new byte[2];
      assertEquals(1, stream.read(sample));
      assertEquals(1, stream.getData().readable());
    } finally {
    }
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.