public synchronized void setVal ( int offset , Constant val ) { byte [ ] byteval = val . asBytes ( ) ; // Append the size of value if it is not fixed size if ( ! val . getType ( ) . isFixedSize ( ) ) { // check the field capacity and value size if ( offset + ByteHelper . INT_SIZE + byteval . length > BLOCK_SIZE ) throw new BufferOverflowException ( ) ; byte [ ] sizeBytes = ByteHelper . toBytes ( byteval . length ) ; contents . put ( offset , sizeBytes ) ; offset += sizeBytes . length ; } // Put bytes contents . put ( offset , byteval ) ; }
Writes a constant value to the specified offset on the page .