Skip to content

Commit

Permalink
Merge pull request #336 from diontools/ImproveStreamSkipping
Browse files Browse the repository at this point in the history
Utility.Skip uses seek
  • Loading branch information
adamhathcock authored Jan 10, 2018
2 parents 02f68b7 + 2fd9fe9 commit d8c8dab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/SharpCompress/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ public static void CheckNotNullOrEmpty(this string obj, string name)

public static void Skip(this Stream source, long advanceAmount)
{
if (source.CanSeek)
{
source.Position += advanceAmount;
return;
}

byte[] buffer = GetTransferByteArray();
try
{
Expand Down

0 comments on commit d8c8dab

Please sign in to comment.