int insert ( Row row , byte [ ] sourceBuffer , int sourceOffset , BlobOutputStream [ ] blobs ) { int rowHead = _rowHead ; int blobTail = _blobTail ; int rowLength = row . length ( ) ; rowHead -= rowLength ; // return false if the block is full if ( rowHead < blobTail ) { return - 1 ; } byte [ ] buffer = _buffer ; System . arraycopy ( sourceBuffer , sourceOffset , buffer , rowHead , rowLength ) ; // XXX: timestamp buffer [ rowHead ] = ( byte ) ( ( buffer [ rowHead ] & ~ CODE_MASK ) | INSERT ) ; blobTail = row . insertBlobs ( buffer , rowHead , blobTail , blobs ) ; // System.out.println("HEXL: " + Hex.toHex(buffer, rowFirst, rowLength)); // if inline blobs can't fit, return false if ( blobTail < 0 ) { return - 1 ; } setBlobTail ( blobTail ) ; rowHead ( rowHead ) ; validateBlock ( row ) ; return rowHead ; }
Inserts a new row into the block .