Remove duplicate class Blob_WaveFile.Blob_RawFile

This commit is contained in:
YoshiRulz 2021-01-02 17:52:23 +10:00
parent 449130e081
commit bb1f7da864
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 1 additions and 38 deletions

View File

@ -17,7 +17,7 @@ namespace BizHawk.Emulation.DiscSystem
private string physicalPath;
private long length;
public long Offset = 0;
public readonly long Offset = 0;
private BufferedStream fs;
public void Dispose()

View File

@ -23,43 +23,6 @@ namespace BizHawk.Emulation.DiscSystem
{
}
private class Blob_RawFile : IBlob
{
public string PhysicalPath
{
get => physicalPath;
set
{
physicalPath = value;
length = new FileInfo(physicalPath).Length;
}
}
private string physicalPath;
private long length;
public readonly long Offset = 0;
private BufferedStream fs;
public void Dispose()
{
fs?.Dispose();
fs = null;
}
public int Read(long byte_pos, byte[] buffer, int offset, int count)
{
//use quite a large buffer, because normally we will be reading these sequentially but in small chunks.
//this enhances performance considerably
const int buffersize = 2352 * 75 * 2;
fs ??= new BufferedStream(new FileStream(physicalPath, FileMode.Open, FileAccess.Read, FileShare.Read), buffersize);
long target = byte_pos + Offset;
if (fs.Position != target)
fs.Position = target;
return fs.Read(buffer, offset, count);
}
public long Length => length;
}
public void Load(byte[] waveData)
{
}