1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-03 06:45:59 +02:00

Moving corlib files out of "System" directory into root

This commit is contained in:
Brian Fiete 2019-09-19 05:46:35 -07:00
parent 4cd58262e4
commit 7dbfd15292
179 changed files with 3 additions and 0 deletions

View file

@ -0,0 +1,78 @@
using System.IO;
namespace System.IO
{
class Substream : Stream
{
public bool mOwnsStream;
Stream mChildStream ~ { if (mOwnsStream) delete _; };
int64 mOffset;
int64 mLength;
public override int64 Position
{
get
{
return mChildStream.Position + mOffset;
}
set
{
mChildStream.Position = value + mOffset;
}
}
public override int64 Length
{
get
{
return mLength;
}
}
public override bool CanRead
{
get
{
return mChildStream.CanRead;
}
}
public override bool CanWrite
{
get
{
return mChildStream.CanWrite;
}
}
public this(Stream childStream, int64 offset, int64 length, bool ownsStream = false)
{
mChildStream = childStream;
mOffset = offset;
mLength = length;
mOwnsStream = ownsStream;
}
public override Result<int> TryRead(Span<uint8> data)
{
return mChildStream.TryRead(data);
}
public override Result<int> TryWrite(Span<uint8> data)
{
return mChildStream.TryWrite(data);
}
public override void Close()
{
mChildStream.Close();
}
public override void Flush()
{
mChildStream.Flush();
}
}
}