-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify compound stream code between normal and mini streams. (#166)
Unify ole streams Fix bug with xls record reader bounds check.
- Loading branch information
Showing
10 changed files
with
165 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,60 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.IO; | ||
|
||
namespace Sylvan.Testing | ||
namespace Sylvan.Testing; | ||
|
||
sealed class TestStream : Stream | ||
{ | ||
class TestStream : Stream | ||
readonly Stream stream; | ||
|
||
public TestStream(Stream stream) | ||
{ | ||
Stream stream; | ||
public TestStream(Stream stream) | ||
{ | ||
this.stream = stream; | ||
} | ||
this.stream = stream; | ||
} | ||
|
||
public override bool CanRead => this.stream.CanRead; | ||
public override bool CanRead => this.stream.CanRead; | ||
|
||
public override bool CanSeek => this.stream.CanSeek; | ||
public override bool CanSeek => this.stream.CanSeek; | ||
|
||
public override bool CanWrite => this.stream.CanWrite; | ||
public override bool CanWrite => this.stream.CanWrite; | ||
|
||
public override long Length => this.stream.Length; | ||
public override long Length => this.stream.Length; | ||
|
||
public bool IsClosed { get; private set; } | ||
public bool IsClosed { get; private set; } | ||
|
||
public override void Close() | ||
{ | ||
this.IsClosed = true; | ||
stream.Close(); | ||
base.Close(); | ||
} | ||
public override void Close() | ||
{ | ||
this.IsClosed = true; | ||
stream.Close(); | ||
base.Close(); | ||
} | ||
|
||
public override long Position { | ||
get => this.stream.Position; | ||
set => this.stream.Position = value; | ||
} | ||
public override long Position { | ||
get => this.stream.Position; | ||
set => this.stream.Position = value; | ||
} | ||
|
||
public override void Flush() | ||
{ | ||
this.stream.Flush(); | ||
} | ||
public override void Flush() | ||
{ | ||
this.stream.Flush(); | ||
} | ||
|
||
public override int Read(byte[] buffer, int offset, int count) | ||
{ | ||
return this.stream.Read(buffer, offset, count); | ||
} | ||
public override int Read(byte[] buffer, int offset, int count) | ||
{ | ||
return this.stream.Read(buffer, offset, count); | ||
} | ||
|
||
public override long Seek(long offset, SeekOrigin origin) | ||
{ | ||
return this.stream.Seek(offset, origin); | ||
} | ||
public override long Seek(long offset, SeekOrigin origin) | ||
{ | ||
return this.stream.Seek(offset, origin); | ||
} | ||
|
||
public override void SetLength(long value) | ||
{ | ||
this.stream.SetLength(value); | ||
} | ||
public override void SetLength(long value) | ||
{ | ||
this.stream.SetLength(value); | ||
} | ||
|
||
public override void Write(byte[] buffer, int offset, int count) | ||
{ | ||
this.stream.Write(buffer, offset, count); | ||
} | ||
public override void Write(byte[] buffer, int offset, int count) | ||
{ | ||
this.stream.Write(buffer, offset, count); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.