public void test_copyStream_fullBlockPlusOne() throws IOException {
  final String id="test";
  final int version=0;
  Random r=new Random();
  final byte[] expected=new byte[BLOCK_SIZE + 1];
  r.nextBytes(expected);
  assertEquals("nbytes",expected.length,repo.copyStream(id,version,new ByteArrayInputStream(expected)));
  assertEquals("blockCount",2,repo.getBlockCount(id,version));
  assertSameIterator("block identifiers",new Long[]{0L,1L},repo.blocks(id,version));
  assertEquals("data",expected,read(repo.inputStream(id,version)));
}

public void test_copyStream_fullBlockPlusOne ( ) throws IOException { final String id = "test" ; final int version = 0 ; Random r = new Random ( ) ; final byte [ ] expected = new byte [ BLOCK_SIZE + 1 ] ; r . nextBytes ( expected ) ; assertEquals ( "nbytes" , expected . length , repo . copyStream ( id , version , new ByteArrayInputStream ( expected ) ) ) ; assertEquals ( "blockCount" , 2 , repo . getBlockCount ( id , version ) ) ; assertSameIterator ( "block identifiers" , new Long [ ] { 0L , 1L } , repo . blocks ( id , version ) ) ; assertEquals ( "data" , expected , read ( repo . inputStream ( id , version ) ) ) ; }
test copy of an stream containing exactly one byte more than a full block of data .
