Allow accessor implementations to override Position property
This commit is contained in:
parent
77bff918cc
commit
a4df8fe080
@ -19,7 +19,8 @@ namespace UniversalEditor
|
||||
public abstract long Length { get; set; }
|
||||
|
||||
private long mvarPosition = 0;
|
||||
public long Position { get { return mvarPosition; } set { mvarPosition = value; Seek(mvarPosition, SeekOrigin.Begin); } }
|
||||
public virtual long Position { get { return mvarPosition; } set { mvarPosition = value; Seek(mvarPosition, SeekOrigin.Begin); } }
|
||||
|
||||
public long Remaining { get { return Length - Position; } }
|
||||
|
||||
public void Seek(int length, SeekOrigin position)
|
||||
|
||||
@ -9,6 +9,11 @@ namespace UniversalEditor.Accessors
|
||||
{
|
||||
public class FileAccessor : Accessor
|
||||
{
|
||||
public override long Position
|
||||
{
|
||||
get { return mvarFileStream.Position; }
|
||||
set { mvarFileStream.Position = value; }
|
||||
}
|
||||
public override long Length
|
||||
{
|
||||
get { return mvarFileStream.Length; }
|
||||
@ -47,7 +52,7 @@ namespace UniversalEditor.Accessors
|
||||
|
||||
internal override int WriteInternal(byte[] buffer, int offset, int count)
|
||||
{
|
||||
mvarFileStream.Write(buffer, offset, count);
|
||||
mvarFileStream.Write(buffer, offset, count);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user