Remove duplicate class Blob_WaveFile.Blob_RawFile
This commit is contained in:
parent
449130e081
commit
bb1f7da864
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue