1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-19 03:52:55 +08:00
osu-lazer/osu.Game/IO/Archives/LegacyByteArrayReader.cs

33 lines
843 B
C#
Raw Normal View History

2020-03-24 13:13:46 +08:00
// 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.
2022-06-17 15:37:17 +08:00
#nullable disable
2020-03-24 13:13:46 +08:00
using System.Collections.Generic;
using System.IO;
namespace osu.Game.IO.Archives
{
/// <summary>
2021-11-12 14:09:01 +08:00
/// Allows reading a single file from the provided byte array.
2020-03-24 13:13:46 +08:00
/// </summary>
public class LegacyByteArrayReader : ArchiveReader
{
private readonly byte[] content;
public LegacyByteArrayReader(byte[] content, string filename)
: base(filename)
{
this.content = content;
}
public override Stream GetStream(string name) => new MemoryStream(content);
public override void Dispose()
{
}
public override IEnumerable<string> Filenames => new[] { Name };
}
}