Package com.peterhi.obsolete

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


     
      for (int i = 0; i < 4; i++) {
        assertEquals(sampleBytes()[i], sample[i]);
      }

      assertEquals(sampleBytes().length - 4, stream.available());
    } finally {
    }
   
    try {
      Stream stream = new Stream();
View Full Code Here


     
      for (int i = 0; i < 4; i++) {
        assertEquals(sampleBytes()[i], sample[i + 1]);
      }
     
      assertEquals(sampleBytes().length - 4, stream.available());
    } finally {
    }
   
    try {
      Stream stream = new Stream();
View Full Code Here

 
  @Test
  public void pAvailable_void() throws Exception {
    try {
      Stream stream = new Stream();
      assertEquals(0, stream.available());
      stream.writeBit(1);
      assertEquals(0, stream.available());
      stream.write(8);
      assertEquals(1, stream.available());
      stream.writeInt(0, 7);
View Full Code Here

  public void pAvailable_void() throws Exception {
    try {
      Stream stream = new Stream();
      assertEquals(0, stream.available());
      stream.writeBit(1);
      assertEquals(0, stream.available());
      stream.write(8);
      assertEquals(1, stream.available());
      stream.writeInt(0, 7);
      assertEquals(2, stream.available());
    } finally {
View Full Code Here

      Stream stream = new Stream();
      assertEquals(0, stream.available());
      stream.writeBit(1);
      assertEquals(0, stream.available());
      stream.write(8);
      assertEquals(1, stream.available());
      stream.writeInt(0, 7);
      assertEquals(2, stream.available());
    } finally {
    }
  }
View Full Code Here

      stream.writeBit(1);
      assertEquals(0, stream.available());
      stream.write(8);
      assertEquals(1, stream.available());
      stream.writeInt(0, 7);
      assertEquals(2, stream.available());
    } finally {
    }
  }
 
  @Test
View Full Code Here

      stream.mark(whatever);
      assertEquals(sampleBytes()[1], (byte )stream.read());
      assertEquals(sampleBytes()[2], (byte )stream.read());
      stream.reset();
      assertEquals(sampleBytes()[1], (byte )stream.read());
      assertEquals(7, stream.available());
    } finally {
    }
  }
 
  @Test
View Full Code Here

      assertEquals(sampleBytes()[1], (byte )stream.read());
      stream.mark(whatever);
      assertEquals(sampleBytes()[2], (byte )stream.read());
      stream.reset();
      assertEquals(sampleBytes()[2], (byte )stream.read());
      assertEquals(6, stream.available());
    } finally {
    }
  }
 
  @Test
View Full Code Here

    try {
      Stream stream = new Stream(sampleBytes());
      byte[] sample = new byte[0];
     
      stream.readFully(sample);
      assertEquals(sampleBytes().length, stream.available());
     
      sample = new byte[2];
      stream.readFully(sample);
     
      for (int i = 0; i < sample.length; i++) {
View Full Code Here

     
      for (int i = 0; i < sample.length; i++) {
        assertEquals(sampleBytes()[i + 2], sample[i]);
      }
     
      assertEquals(0, stream.available());
      sample = new byte[0];
      stream.readFully(sample);
      assertEquals(0, stream.available());
    } 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.