Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
vpenades committed Aug 26, 2022
2 parents 9458ea8 + 4ba2963 commit 6e4f54e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/SharpCompress/Compressors/LZMA/ICoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public InvalidParamException()
}
}

internal interface ICodeProgress
public interface ICodeProgress
{
/// <summary>
/// Callback progress.
Expand Down Expand Up @@ -169,4 +169,4 @@ internal interface ISetDecoderProperties
{
void SetDecoderProperties(byte[] properties);
}
}
}
2 changes: 1 addition & 1 deletion src/SharpCompress/Compressors/LZMA/LzmaDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace SharpCompress.Compressors.LZMA
{
internal class Decoder : ICoder, ISetDecoderProperties // ,System.IO.Stream
public class Decoder : ICoder, ISetDecoderProperties // ,System.IO.Stream
{
private class LenDecoder
{
Expand Down
12 changes: 10 additions & 2 deletions src/SharpCompress/IO/SourceStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,17 @@ public override int Read(byte[] buffer, int offset, int count)

if (!IsVolumes && count != 0 && Current.Position == Current.Length)
{
_prevSize += Current.Length;
if (!SetStream(_stream + 1)) //will load next file if present
var length = Current.Length;

// Load next file if present
if (!SetStream(_stream + 1))
{
break;
}

// Current stream switched
// Add length of previous stream
_prevSize += length;
Current.Seek(0, SeekOrigin.Begin);
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/SharpCompress/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,8 @@ public static bool Find(this Stream source, byte[] array)
byte[] buffer = GetTransferByteArray();
try
{
var pos = source.Position;
int count = 0;
var len = source.Read(buffer, 0, buffer.Length);
source.Position = pos + len;

do
{
Expand Down

0 comments on commit 6e4f54e

Please sign in to comment.