public void write(long record, int column, byte[] bytes) throws IOException {
        if (readonly) {
            throw new UnsupportedOperationException(RO_MSG);
        }

        // (+ recordSize) allows skipping metadata record
        long pos = record * recordSize + recordSize;

        int i = 0;
        for (; i < column; i++) {
            pos += columns[i].size;
        }
        if (pos >= size) {
            final String fmt = "bad seek to position: %d (size is %d)";
            final String msg = format(fmt, pos, size);
            throw new InvalidArgument(msg);
        }
        Column<?> c = columns[i];
        if (bytes.length != c.size) {
            final String fmt = "invalid write of %d bytes, expected %d";
            final String msg = format(fmt, bytes.length, c.size);
            throw new InvalidArgument(msg);
        }

        raf.seek(pos);
        raf.write(bytes);
    }
public void write ( long record , int column , byte [ ] bytes ) throws IOException { if ( readonly ) { throw new UnsupportedOperationException ( RO_MSG ) ; } long pos = record * recordSize + recordSize ; int i = 0 ; for ( ; i < column ; i ++ ) { pos += columns [ i ] . size ; } if ( pos >= size ) { final String fmt = "bad seek to position: %d (size is %d)" ; final String msg = format ( fmt , pos , size ) ; throw new InvalidArgument ( msg ) ; } Column < ? > c = columns [ i ] ; if ( bytes . length != c . size ) { final String fmt = "invalid write of %d bytes, expected %d" ; final String msg = format ( fmt , bytes . length , c . size ) ; throw new InvalidArgument ( msg ) ; } raf . seek ( pos ) ; raf . write ( bytes ) ; }
Writes a record for a specific column to this record file, overwriting
the previous contents.

@param record The record being written
@param column The column to write
@param bytes The bytes to write
@throws IOException Thrown if an I/O error occurs during I/O seeks or
writes
@throws InvalidArgument Thrown if a write of anything other than the size
of the column is requested
@throws UnsupportedOperationException Thrown if the mode is set to
read-only