Test creating a SmallDocumentBlockList
byte[] data = new byte[ 2560 ];
for (int j = 0; j < 2560; j++)
{
data[ j ] = ( byte ) j;
}
ByteArrayInputStream stream = new ByteArrayInputStream(data);
RawDataBlock[] blocks = new RawDataBlock[ 5 ];
for (int j = 0; j < 5; j++)
{
blocks[ j ] = new RawDataBlock(stream);
}
SmallDocumentBlockList sdbl =
new SmallDocumentBlockList(SmallDocumentBlock.extract(blocks));
// proof we added the blocks
for (int j = 0; j < 40; j++)
{
sdbl.remove(j);
}
try
{
sdbl.remove(41);
fail("there should have been an Earth-shattering ka-boom!");
}
catch (IOException ignored)
{
// it better have thrown one!!
}