mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-16 23:34:10 +02:00
Large collection fixes
This commit is contained in:
parent
e8880cd59c
commit
d0de4776f3
5 changed files with 25 additions and 10 deletions
|
@ -280,6 +280,11 @@ namespace System.IO
|
|||
|
||||
class BufferedFileStream : BufferedStream, IFileStream
|
||||
{
|
||||
public struct PositionRestorer : this(BufferedFileStream stream, int prevPosition), IDisposable
|
||||
{
|
||||
public void Dispose() => stream.Position = prevPosition;
|
||||
}
|
||||
|
||||
protected Platform.BfpFile* mBfpFile;
|
||||
protected int64 mBfpFilePos;
|
||||
FileAccess mFileAccess;
|
||||
|
@ -329,11 +334,6 @@ namespace System.IO
|
|||
Delete();
|
||||
}
|
||||
|
||||
protected virtual void Delete()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
public this(Platform.BfpFile* handle, FileAccess access, int32 bufferSize, bool isAsync)
|
||||
{
|
||||
mBfpFile = handle;
|
||||
|
@ -440,6 +440,18 @@ namespace System.IO
|
|||
return .Ok;
|
||||
}
|
||||
|
||||
public PositionRestorer PushPosition(int position)
|
||||
{
|
||||
PositionRestorer restorer = .(this, Position);
|
||||
Position = position;
|
||||
return restorer;
|
||||
}
|
||||
|
||||
protected virtual void Delete()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
public override Result<void> Seek(int64 pos, SeekKind seekKind = .Absolute)
|
||||
{
|
||||
int64 newPos;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue