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