protected function write($namespace, array $data)
    {
        $file = $this->adapter->getFileName($namespace);
        $contents = $this->adapter->prepareForWriting($data);
        if (!$this->fileSystem->has($file)) {
            $this->fileSystem->write($file, $contents);
        }

        $this->fileSystem->update($file, $contents);
    }