private bool TryAddFile(int handle, Stream stream, bool ownsStream, ConflictPolicy policy)
        {
            if (mEntryMap.TryGetValue(handle, out _))
            {
                switch (policy.Kind)
                {
                case ConflictPolicy.PolicyKind.ThrowError:
                    throw new FileExistsException <int>(handle);

                case ConflictPolicy.PolicyKind.Replace:
                    // Handled later
                    break;

                case ConflictPolicy.PolicyKind.Ignore:
                    return(false);
                }
            }

            mEntryMap[handle] = new MemoryEntry(handle, stream, ownsStream);

            return(true);
        }
        public void AddFile(Stream stream, bool ownsStream = true)
        {
            var entry = new MemoryEntry(AllocateHandle(), stream, ownsStream);

            mEntryMap[AllocateHandle()] = entry;
        }