Package dijjer.io.xfer

Examples of dijjer.io.xfer.InputStreamBlockReceiver.start()


  public void testISBR() throws Exception {
    byte[] ba1 = new byte[1000];
    ByteArrayInputStream bais = new ByteArrayInputStream(ba1);
    PartiallyReceivedBlock prb1 = new PartiallyReceivedBlock(100, 10);
    InputStreamBlockReceiver isbr1 = new InputStreamBlockReceiver(prb1, bais);
    isbr1.start();
    assertTrue(prb1.allReceived());
    byte[] ba2 = prb1.getBlock();
    for(int x=0; x<ba2.length; x++) {
      assertEquals(ba1[x], ba2[x]);
    }
View Full Code Here


    }
   
    bais.reset();
    PartiallyReceivedBlock prb2 = new PartiallyReceivedBlock(100, 11);
    InputStreamBlockReceiver isbr2 = new InputStreamBlockReceiver(prb2, bais);
    isbr2.start();
   
    byte[] ba3 = prb2.getBlock();
    for (int x=0; x<ba1.length; x++) {
      assertEquals(ba1[x], ba3[x]);
    }
View Full Code Here

        }
     
      //Stuff below here is only executed once
      InputStream is = uc.getInputStream();
      InputStreamBlockReceiver isrb = new InputStreamBlockReceiver(_prb, is);
      isrb.start();
      break;
    }
  }
}
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.