code: @Override
  	public final int replace(int handle, Object obj) throws DataStoreException
      {
      	if (SAFE_MODE)
      		checkHandle(handle);
      	
      	byte[] data = asByteArray(obj);
      	int previousHandle = previousBlock[handle];
      	
      	// Make sure we have enough space to do this
      	int originalBlocks = computeBlocks(handle);
      	int targetBlocks = (data.length/blockSize) + ((data.length % blockSize) > 0 ? 1 : 0);
      	if (targetBlocks > originalBlocks)
      	{
      		int requiredFreeBlocks = targetBlocks-originalBlocks;
      		if (requiredFreeBlocks+blocksInUse > blockCount)
      		{
          		log.error("["+descriptor.getName()+"] Not enough free blocks to update message ("+requiredFreeBlocks+" needed, "+(blockCount-blocksInUse)+" left), queue is full.");
          		return -1;
      		}
      	}
  
      	// Save locking status
      	boolean wasLocked = isLocked(handle);
      	
      	// Delete the old message
      	delete(handle);
      	
      	// Store the new version
      	int newHandle = store(obj, previousHandle);
      	
      	// Re-lock if necessary
      	if (wasLocked)
      		lock(newHandle);
      	
      	flush();
      	
      	return newHandle;
      }
docs: /* (non-Javadoc)
  @see net.timewalker.ffmq4.storage.data.LinkedDataStore#replace(int, java.lang.Object)