20 namespace Deveel.Data.Store {
26 throw new ArgumentNullException(
"area");
35 public override long Seek(
long offset, SeekOrigin origin) {
36 if (origin == SeekOrigin.Begin) {
38 throw new ArgumentOutOfRangeException(
"offset");
40 area.Position = (int) offset;
41 }
else if (origin == SeekOrigin.Current) {
42 var pos = area.Position;
43 var length = area.Length;
44 if (pos + offset >= length)
45 throw new ArgumentOutOfRangeException(
"offset");
47 area.Position = pos + (int)offset;
49 var length = area.Length;
50 var newPos = length - offset;
52 throw new ArgumentOutOfRangeException(
"offset");
54 area.Position = (int)newPos;
61 throw new NotSupportedException();
64 public override int Read(byte[] buffer,
int offset,
int count) {
65 return area.Read(buffer, offset, count);
68 public override void Write(byte[] buffer,
int offset,
int count) {
69 area.Write(buffer, offset, count);
72 public override bool CanRead {
76 public override bool CanSeek {
80 public override bool CanWrite {
81 get {
return !area.IsReadOnly; }
84 public override long Length {
85 get {
return area.Length; }
88 public override long Position {
89 get {
return area.Position; }
90 set { Seek(value, SeekOrigin.Begin); }
override void SetLength(long value)
An interface for access the contents of an area of a store.
override long Seek(long offset, SeekOrigin origin)
override void Write(byte[] buffer, int offset, int count)
override int Read(byte[] buffer, int offset, int count)