work on #816
This commit is contained in:
parent
a8aef42038
commit
5488eadb89
|
@ -65,18 +65,18 @@ namespace BizHawk.Client.Common
|
||||||
BinaryReader br;
|
BinaryReader br;
|
||||||
bool mDisk;
|
bool mDisk;
|
||||||
|
|
||||||
Stream stream;
|
Stream stream;
|
||||||
public StreamStringLog(bool disk)
|
public StreamStringLog(bool disk)
|
||||||
{
|
{
|
||||||
mDisk = disk;
|
mDisk = disk;
|
||||||
if (disk)
|
if (disk)
|
||||||
{
|
{
|
||||||
var path = TempFileCleaner.GetTempFilename("movieOnDisk");
|
var path = TempFileCleaner.GetTempFilename("movieOnDisk");
|
||||||
stream = new FileStream(path, FileMode.Create, System.Security.AccessControl.FileSystemRights.FullControl, FileShare.None, 4 * 1024, FileOptions.DeleteOnClose);
|
stream = new FileStream(path, FileMode.Create, System.Security.AccessControl.FileSystemRights.FullControl, FileShare.None, 4 * 1024, FileOptions.DeleteOnClose);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stream = new AWEMemoryStream();
|
stream = new AWEMemoryStream();
|
||||||
}
|
}
|
||||||
bw = new BinaryWriter(stream);
|
bw = new BinaryWriter(stream);
|
||||||
br = new BinaryReader(stream);
|
br = new BinaryReader(stream);
|
||||||
|
@ -105,7 +105,8 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Add(string str)
|
public void Add(string str)
|
||||||
{
|
{
|
||||||
|
stream.Position = stream.Length;
|
||||||
Offsets.Add(stream.Position);
|
Offsets.Add(stream.Position);
|
||||||
bw.Write(str);
|
bw.Write(str);
|
||||||
bw.Flush();
|
bw.Flush();
|
||||||
|
@ -134,7 +135,8 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Insert(int index, string val)
|
public void Insert(int index, string val)
|
||||||
{
|
{
|
||||||
|
stream.Position = stream.Length;
|
||||||
Offsets.Insert(index, stream.Position);
|
Offsets.Insert(index, stream.Position);
|
||||||
bw.Write(val);
|
bw.Write(val);
|
||||||
bw.Flush();
|
bw.Flush();
|
||||||
|
|
Loading…
Reference in New Issue