public long addRecord ( final ORecordId iRid , final byte [ ] iContent ) throws IOException { if ( iContent . length == 0 ) // AVOID UNUSEFUL CREATION OF EMPTY RECORD: IT WILL BE CREATED AT FIRST UPDATE return - 1 ; final int recordSize = iContent . length + RECORD_FIX_SIZE ; acquireExclusiveLock ( ) ; try { final long [ ] newFilePosition = getFreeSpace ( recordSize ) ; writeRecord ( newFilePosition , iRid . clusterId , iRid . clusterPosition , iContent ) ; return getAbsolutePosition ( newFilePosition ) ; } finally { releaseExclusiveLock ( ) ; } }
Add the record content in file .