mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Add encoding and import support
This commit is contained in:
30
osu.Game/IO/Archives/LegacyByteArrayReader.cs
Normal file
30
osu.Game/IO/Archives/LegacyByteArrayReader.cs
Normal file
@ -0,0 +1,30 @@
|
||||
// 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.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace osu.Game.IO.Archives
|
||||
{
|
||||
/// <summary>
|
||||
/// Allows reading a single file from the provided stream.
|
||||
/// </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 };
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user