public void test_copyStream_largeStream() throws IOException {
  final String id="test";
  final int version=0;
  Random r=new Random();
  final int N=10;
  final byte[] expected=new byte[N * BLOCK_SIZE + r.nextInt(BLOCK_SIZE - 1) + 1];
  r.nextBytes(expected);
  assertEquals("nbytes",expected.length,repo.copyStream(id,version,new ByteArrayInputStream(expected)));
  assertEquals("blockCount",N + 1,repo.getBlockCount(id,version));
{
    final Long[] blockIds=new Long[N + 1];
    for (int i=0; i < N + 1; i++) {
      blockIds[i]=(long)i;
    }
    assertSameIterator("block identifiers",blockIds,repo.blocks(id,version));
  }
  assertEquals("data",expected,read(repo.inputStream(id,version)));
}

public void test_copyStream_largeStream ( ) throws IOException { final String id = "test" ; final int version = 0 ; Random r = new Random ( ) ; final int N = 10 ; final byte [ ] expected = new byte [ N * BLOCK_SIZE + r . nextInt ( BLOCK_SIZE - 1 ) + 1 ] ; r . nextBytes ( expected ) ; assertEquals ( "nbytes" , expected . length , repo . copyStream ( id , version , new ByteArrayInputStream ( expected ) ) ) ; assertEquals ( "blockCount" , N + 1 , repo . getBlockCount ( id , version ) ) ; { final Long [ ] blockIds = new Long [ N + 1 ] ; for ( int i = 0 ; i < N + 1 ; i ++ ) { blockIds [ i ] = ( long ) i ; } assertSameIterator ( "block identifiers" , blockIds , repo . blocks ( id , version ) ) ; } assertEquals ( "data" , expected , read ( repo . inputStream ( id , version ) ) ) ; }
test the ability to write a stream onto the index that is automatically partitioned into blocks .
