Package com.peterhi.obsolete

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


 
  @Test
  public void pReadShort_void() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
     
      for (short sh : sampleShorts()) {
        stream.writeShort(sh);
      }
     
View Full Code Here


     
      for (short sh : sampleShorts()) {
        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

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

 
  @Test
  public void pReadUnsignedShort_void() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
     
      for (short sh : sampleShorts()) {
        stream.writeShort(sh);
      }
     
View Full Code Here

     
      for (short sh : sampleShorts()) {
        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

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

 
  @Test
  public void pReadChar_void() throws Exception {
    try {
      Stream stream = new Stream();
      stream.writeBit(1);
     
      for (char ch : sampleChars()) {
        stream.writeChar(ch);
      }
     
View Full Code Here

     
      for (char ch : sampleChars()) {
        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

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

 
  @Test
  public void pReadInt_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

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.