File tree Expand file tree Collapse file tree
test/ICSharpCode.SharpZipLib.Tests/Zip Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ public void ZipFileStoreAes()
150150 [ Test ]
151151 [ Category ( "Encryption" ) ]
152152 [ Category ( "Zip" ) ]
153- public void ZipFileStoreAesPartialRead ( )
153+ public void ZipFileStoreAesPartialRead ( [ Values ( 1 , 7 , 17 ) ] int readSize )
154154 {
155155 string password = "password" ;
156156
@@ -179,16 +179,16 @@ public void ZipFileStoreAesPartialRead()
179179 {
180180 using ( var zis = zipFile . GetInputStream ( entry ) )
181181 {
182- byte [ ] buffer = new byte [ 1 ] ;
182+ byte [ ] buffer = new byte [ readSize ] ;
183183
184184 while ( true )
185185 {
186- int b = zis . ReadByte ( ) ;
186+ int read = zis . Read ( buffer , 0 , readSize ) ;
187187
188- if ( b == - 1 )
188+ if ( read == 0 )
189189 break ;
190190
191- ms . WriteByte ( ( byte ) b ) ;
191+ ms . Write ( buffer , 0 , read ) ;
192192 }
193193 }
194194
You can’t perform that action at this time.
0 commit comments