new ByteArrayInputStream(bytes));
// Truncate the BLOB. This used to fail with "Reached EOF prematurely"
// because truncate() didn't move the position in the underlying stream
// back to the beginning.
blob.truncate(4000);
// Verify that the BLOB was truncated correctly.
assertEquals(4000, blob.length());
bytes = blob.getBytes(1, 4000);
assertEquals(new LoopingAlphabetStream(4000),