Skip to content

Commit 433e2f4

Browse files
authored
Merge PR #283: Cleanup, editorconfig, docs and obsolete refs
- Apply .editorconfig code standard across all code - Mark private fields readonly when possible - Fix obsolete warnings - Add/fix missing documentation - Normalize code and whitespace
1 parent 96e5c1f commit 433e2f4

File tree

87 files changed

+8105
-4653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+8105
-4653
lines changed

src/ICSharpCode.SharpZipLib/BZip2/BZip2.cs

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,58 +9,69 @@ namespace ICSharpCode.SharpZipLib.BZip2
99
public static class BZip2
1010
{
1111
/// <summary>
12-
/// Decompress the <paramref name="inStream">input</paramref> writing
12+
/// Decompress the <paramref name="inStream">input</paramref> writing
1313
/// uncompressed data to the <paramref name="outStream">output stream</paramref>
1414
/// </summary>
1515
/// <param name="inStream">The readable stream containing data to decompress.</param>
1616
/// <param name="outStream">The output stream to receive the decompressed data.</param>
1717
/// <param name="isStreamOwner">Both streams are closed on completion if true.</param>
1818
public static void Decompress(Stream inStream, Stream outStream, bool isStreamOwner)
1919
{
20-
if (inStream == null || outStream == null) {
20+
if (inStream == null || outStream == null)
21+
{
2122
throw new Exception("Null Stream");
2223
}
2324

24-
try {
25-
using (BZip2InputStream bzipInput = new BZip2InputStream(inStream)) {
25+
try
26+
{
27+
using (BZip2InputStream bzipInput = new BZip2InputStream(inStream))
28+
{
2629
bzipInput.IsStreamOwner = isStreamOwner;
2730
Core.StreamUtils.Copy(bzipInput, outStream, new byte[4096]);
2831
}
29-
} finally {
30-
if (isStreamOwner) {
32+
}
33+
finally
34+
{
35+
if (isStreamOwner)
36+
{
3137
// inStream is closed by the BZip2InputStream if stream owner
3238
outStream.Dispose();
3339
}
3440
}
3541
}
3642

3743
/// <summary>
38-
/// Compress the <paramref name="inStream">input stream</paramref> sending
44+
/// Compress the <paramref name="inStream">input stream</paramref> sending
3945
/// result data to <paramref name="outStream">output stream</paramref>
4046
/// </summary>
4147
/// <param name="inStream">The readable stream to compress.</param>
4248
/// <param name="outStream">The output stream to receive the compressed data.</param>
4349
/// <param name="isStreamOwner">Both streams are closed on completion if true.</param>
44-
/// <param name="level">Block size acts as compression level (1 to 9) with 1 giving
50+
/// <param name="level">Block size acts as compression level (1 to 9) with 1 giving
4551
/// the lowest compression and 9 the highest.</param>
4652
public static void Compress(Stream inStream, Stream outStream, bool isStreamOwner, int level)
4753
{
48-
if (inStream == null || outStream == null) {
54+
if (inStream == null || outStream == null)
55+
{
4956
throw new Exception("Null Stream");
5057
}
5158

52-
try {
53-
using (BZip2OutputStream bzipOutput = new BZip2OutputStream(outStream, level)) {
59+
try
60+
{
61+
using (BZip2OutputStream bzipOutput = new BZip2OutputStream(outStream, level))
62+
{
5463
bzipOutput.IsStreamOwner = isStreamOwner;
5564
Core.StreamUtils.Copy(inStream, bzipOutput, new byte[4096]);
5665
}
57-
} finally {
58-
if (isStreamOwner) {
66+
}
67+
finally
68+
{
69+
if (isStreamOwner)
70+
{
5971
// outStream is closed by the BZip2OutputStream if stream owner
6072
inStream.Dispose();
6173
}
6274
}
6375
}
64-
6576
}
6677
}

src/ICSharpCode.SharpZipLib/BZip2/BZip2Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ internal sealed class BZip2Constants
6666
/// <summary>
6767
/// When multiplied by compression parameter (1-9) gives the block size for compression
6868
/// 9 gives the best compression but uses the most memory.
69-
/// </summary>
69+
/// </summary>
7070
public const int BaseBlockSize = 100000;
7171

7272
/// <summary>

0 commit comments

Comments
 (0)