Imported Upstream version 4.8.0.425

Former-commit-id: 56934f10a9ad11e3eb75c21da859e02f54766140
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-01-09 11:04:53 +00:00
parent 693afccc61
commit 2927bc3cc3
47 changed files with 479 additions and 354 deletions

View File

@ -507,6 +507,11 @@ namespace MonoTests.System.IO.Compression
/// Simulate "CanSeek" is false, which is the case when you are retreiving data from web.
/// </summary>
public override bool CanSeek => false;
public override long Position {
get {throw new NotSupportedException();}
set {throw new NotSupportedException();}
}
}
[Test]
@ -517,5 +522,16 @@ namespace MonoTests.System.IO.Compression
{
}
}
[Test]
public void ZipWriteNonSeekableStream() {
var stream = new MyFakeStream( "test.nupkg", FileMode.Open );
using ( var archive = new ZipArchive( stream, ZipArchiveMode.Create ) ) {
var entry = archive.CreateEntry( "foo" );
using ( var es = entry.Open() ) {
es.Write( new byte[] { 4, 2 }, 0, 2 );
}
}
}
}
}