file.delete();
FileOutputStream out = new FileOutputStream(file);
out.write(buf);
out.close();
FilePersistedValueData vd = new FilePersistedValueData(0, file);
assertFalse(vd.isByteArray());
assertEquals(10, vd.getLength());
assertEquals(0, vd.getOrderNumber());
try
{
vd.getAsByteArray();
}
catch (IllegalStateException e)
{
fail("IllegalStateException should not have been thrown!");
}
assertTrue(vd.getAsStream() instanceof FileInputStream);
}