mirror of
https://github.com/ppy/osu.git
synced 2024-12-21 15:33:22 +08:00
33 lines
843 B
C#
33 lines
843 B
C#
// 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.
|
|
|
|
#nullable disable
|
|
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace osu.Game.IO.Archives
|
|
{
|
|
/// <summary>
|
|
/// Allows reading a single file from the provided byte array.
|
|
/// </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 };
|
|
}
|
|
}
|