public void store(final long address, final byte[] data) {
    Preconditions.checkArgument(address >= 0, "Error: Address can't be less than 0");
    Preconditions.checkNotNull(data, "Error: Data can't be null");

    try {
      m_writeLock.lock();

      // Simply delete the old data before writing it, this makes things very simple.
      remove(address, data.length);

      final MemoryChunk chunk = new MemoryChunk(address, data);
      insertChunk(chunk);

      final MemoryChunk nextChunk = findChunk(address + chunk.getLength());

      if (nextChunk != null) {
        connectChunks(chunk, nextChunk);
      }
    } finally {
      m_writeLock.unlock();
    }

    notifyListeners(address, data.length);
  }
Stores new data at a given memory address.

@param address The address where the data is stored.
@param data The data to store.
@throws IllegalArgumentException Thrown if the address is less than 0.
@throws NullPointerException Thrown if the data object is null.
java/zylib/src/main/java/com/google/security/zynamics/zylib/general/memmanager/Memory.java