code: func (rd *RAMDirectory) CreateOutput(name string, context IOContext) (out IndexOutput, err error) {
  	rd.EnsureOpen()
  	file := rd.newRAMFile()
  	rd.fileMapLock.Lock()
  	defer rd.fileMapLock.Unlock()
  	if existing, ok := rd.fileMap[name]; ok {
  		atomic.AddInt64(&rd.sizeInBytes, -existing.sizeInBytes)
  		existing.directory = nil
  	}
  	rd.fileMap[name] = file
  	return NewRAMOutputStream(file, true), nil
  }
docs: // Creates a new, empty file in the directory with the given name.
  // Returns a stream writing this file: