1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-08 05:03:38 +08:00

Rework CloseStream

This commit is contained in:
Naxesss
2021-10-12 00:30:00 +02:00
Unverified
parent 47b4d03145
commit d4779f06cf
@@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.IO;
namespace osu.Game.IO.FileAbstraction
@@ -18,9 +19,12 @@ namespace osu.Game.IO.FileAbstraction
public Stream ReadStream { get; }
public Stream WriteStream => ReadStream;
public void CloseStream(Stream aStream)
public void CloseStream(Stream stream)
{
aStream.Position = 0;
if (stream == null)
throw new ArgumentNullException(nameof(stream));
stream.Close();
}
}
}