Package com.peterhi.obsolete

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


    } finally {
    }
   
    try {
      Stream stream = new Stream();
      stream.readFully(new byte[1], 1, 1);
      fail();
    } catch (IndexOutOfBoundsException ex) {
    } finally {
    }
   
View Full Code Here


    }
   
    try {
      Stream stream = new Stream();
      stream.write(1);
      stream.readFully(new byte[2], 0, 2);
      fail();
    } catch (InsufficientBufferException ex) {
    } finally {
    }
   
View Full Code Here

    }
   
    try {
      Stream stream = new Stream();
      stream.writeInt(0, 3);
      stream.readFully(new byte[1], 0, 1);
      fail();
    } catch (InsufficientBufferException ex) {
    } finally {
    }
  }
View Full Code Here

  public void pReadFully_byteArray_int_int() throws Exception {
    try {
      Stream stream = new Stream(sampleBytes());
      byte[] sample = new byte[0];
     
      stream.readFully(sample, 0, sample.length);
      assertEquals(sampleBytes().length, stream.available());
     
      sample = new byte[50];
      stream.readFully(sample, 25, 0);
      assertEquals(sampleBytes().length, stream.available());
View Full Code Here

     
      stream.readFully(sample, 0, sample.length);
      assertEquals(sampleBytes().length, stream.available());
     
      sample = new byte[50];
      stream.readFully(sample, 25, 0);
      assertEquals(sampleBytes().length, stream.available());
     
      sample = new byte[10];
      stream.readFully(sample, 1, 2);
     
View Full Code Here

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

     
      for (int i = 0; i < 2; i++) {
        assertEquals(sampleBytes()[i], sample[i + 1]);
      }
     
      stream.readFully(sample, 2, 7);
     
      for (int i = 0; i < 7; i++) {
        assertEquals(sampleBytes()[i + 2], sample[i + 2]);
      }
     
View Full Code Here

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