{
throw new IllegalArgumentException("Invalid data size " + dataSize + ". It must be a multiple of the key size + record size");
}
m_dbFile.seek(m_startPosOfDb);
m_dbFile.setLength(m_startPosOfDb);
long noCopied = StreamUtil.copyStreams(new RandomAccessToInputStreamAdapter(ra), new RandomAccessToOutputStreamAdapter(m_dbFile), m_bufferSize, dataSize);
if (noCopied != dataSize)
{
throw new DatabaseException("Wanted to copy " + dataSize + " bytes. Got " + noCopied);
}
updateContentsVersion();