Permalink
Browse files

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
  • Loading branch information...
piksel committed Nov 12, 2018
1 parent 96e5c1f commit 433e2f4e8147e78cf9c67c7c47812f8e5b3e6492
Showing with 8,105 additions and 4,653 deletions.
  1. +25 −14 src/ICSharpCode.SharpZipLib/BZip2/BZip2.cs
  2. +1 −1 src/ICSharpCode.SharpZipLib/BZip2/BZip2Constants.cs
  3. +309 −178 src/ICSharpCode.SharpZipLib/BZip2/BZip2InputStream.cs
  4. +604 −356 src/ICSharpCode.SharpZipLib/BZip2/BZip2OutputStream.cs
  5. +22 −17 src/ICSharpCode.SharpZipLib/Checksum/Adler32.cs
  6. +14 −9 src/ICSharpCode.SharpZipLib/Checksum/BZip2Crc.cs
  7. +16 −10 src/ICSharpCode.SharpZipLib/Checksum/Crc32.cs
  8. +2 −1 src/ICSharpCode.SharpZipLib/Checksum/IChecksum.cs
  9. +6 −6 src/ICSharpCode.SharpZipLib/Core/Exceptions/SharpZipBaseException.cs
  10. +5 −8 src/ICSharpCode.SharpZipLib/Core/Exceptions/StreamDecodingException.cs
  11. +0 −2 src/ICSharpCode.SharpZipLib/Core/Exceptions/StreamUnsupportedException.cs
  12. +0 −2 src/ICSharpCode.SharpZipLib/Core/Exceptions/UnexpectedEndOfStreamException.cs
  13. +11 −8 src/ICSharpCode.SharpZipLib/Core/Exceptions/ValueOutOfRangeException.cs
  14. +142 −72 src/ICSharpCode.SharpZipLib/Core/FileSystemScanner.cs
  15. +3 −6 src/ICSharpCode.SharpZipLib/Core/InvalidNameException.cs
  16. +89 −41 src/ICSharpCode.SharpZipLib/Core/NameFilter.cs
  17. +77 −39 src/ICSharpCode.SharpZipLib/Core/PathFilter.cs
  18. +53 −25 src/ICSharpCode.SharpZipLib/Core/StreamUtils.cs
  19. +18 −8 src/ICSharpCode.SharpZipLib/Core/WindowsPathUtils.cs
  20. +97 −57 src/ICSharpCode.SharpZipLib/Encryption/PkzipClassic.cs
  21. +24 −13 src/ICSharpCode.SharpZipLib/Encryption/ZipAESStream.cs
  22. +34 −23 src/ICSharpCode.SharpZipLib/Encryption/ZipAESTransform.cs
  23. +4 −5 src/ICSharpCode.SharpZipLib/GZip/GZip.cs
  24. +2 −2 src/ICSharpCode.SharpZipLib/GZip/GZipConstants.cs
  25. +117 −78 src/ICSharpCode.SharpZipLib/GZip/GzipInputStream.cs
  26. +48 −24 src/ICSharpCode.SharpZipLib/GZip/GzipOutputStream.cs
  27. +2 −1 src/ICSharpCode.SharpZipLib/Lzw/LzwConstants.cs
  28. +92 −53 src/ICSharpCode.SharpZipLib/Lzw/LzwInputStream.cs
  29. +274 −146 src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs
  30. +113 −62 src/ICSharpCode.SharpZipLib/Tar/TarBuffer.cs
  31. +104 −53 src/ICSharpCode.SharpZipLib/Tar/TarEntry.cs
  32. +0 −1 src/ICSharpCode.SharpZipLib/Tar/TarException.cs
  33. +20 −10 src/ICSharpCode.SharpZipLib/Tar/TarExtendedHeaderReader.cs
  34. +213 −133 src/ICSharpCode.SharpZipLib/Tar/TarHeader.cs
  35. +129 −67 src/ICSharpCode.SharpZipLib/Tar/TarInputStream.cs
  36. +80 −44 src/ICSharpCode.SharpZipLib/Tar/TarOutputStream.cs
  37. +129 −82 src/ICSharpCode.SharpZipLib/Zip/Compression/Deflater.cs
  38. +21 −22 src/ICSharpCode.SharpZipLib/Zip/Compression/DeflaterConstants.cs
  39. +322 −239 src/ICSharpCode.SharpZipLib/Zip/Compression/DeflaterEngine.cs
  40. +212 −118 src/ICSharpCode.SharpZipLib/Zip/Compression/DeflaterHuffman.cs
  41. +1 −1 src/ICSharpCode.SharpZipLib/Zip/Compression/DeflaterPending.cs
  42. +199 −112 src/ICSharpCode.SharpZipLib/Zip/Compression/Inflater.cs
  43. +12 −16 src/ICSharpCode.SharpZipLib/Zip/Compression/InflaterDynHeader.cs
  44. +54 −29 src/ICSharpCode.SharpZipLib/Zip/Compression/InflaterHuffmanTree.cs
  45. +38 −26 src/ICSharpCode.SharpZipLib/Zip/Compression/PendingBuffer.cs
  46. +102 −57 src/ICSharpCode.SharpZipLib/Zip/Compression/Streams/DeflaterOutputStream.cs
  47. +156 −80 src/ICSharpCode.SharpZipLib/Zip/Compression/Streams/InflaterInputStream.cs
  48. +51 −26 src/ICSharpCode.SharpZipLib/Zip/Compression/Streams/OutputWindow.cs
  49. +48 −25 src/ICSharpCode.SharpZipLib/Zip/Compression/Streams/StreamManipulator.cs
  50. +250 −136 src/ICSharpCode.SharpZipLib/Zip/FastZip.cs
  51. +60 −32 src/ICSharpCode.SharpZipLib/Zip/WindowsNameTransform.cs
  52. +40 −12 src/ICSharpCode.SharpZipLib/Zip/ZipConstants.cs
  53. +343 −177 src/ICSharpCode.SharpZipLib/Zip/ZipEntry.cs
  54. +75 −40 src/ICSharpCode.SharpZipLib/Zip/ZipEntryFactory.cs
  55. +0 −1 src/ICSharpCode.SharpZipLib/Zip/ZipException.cs
  56. +180 −97 src/ICSharpCode.SharpZipLib/Zip/ZipExtraData.cs
  57. +1,247 −696 src/ICSharpCode.SharpZipLib/Zip/ZipFile.cs
  58. +140 −72 src/ICSharpCode.SharpZipLib/Zip/ZipHelperStream.cs
  59. +193 −109 src/ICSharpCode.SharpZipLib/Zip/ZipInputStream.cs
  60. +59 −29 src/ICSharpCode.SharpZipLib/Zip/ZipNameTransform.cs
  61. +259 −133 src/ICSharpCode.SharpZipLib/Zip/ZipOutputStream.cs
  62. +5 −7 src/ICSharpCode.SharpZipLib/Zip/ZipStrings.cs
  63. +4 −7 test/ICSharpCode.SharpZipLib.TestBootstrapper/Program.cs
  64. +21 −18 test/ICSharpCode.SharpZipLib.Tests/BZip2/Bzip2Tests.cs
  65. +66 −41 test/ICSharpCode.SharpZipLib.Tests/Base/InflaterDeflaterTests.cs
  66. +33 −16 test/ICSharpCode.SharpZipLib.Tests/Checksum/ChecksumTests.cs
  67. +6 −3 test/ICSharpCode.SharpZipLib.Tests/Core/CoreTests.cs
  68. +54 −48 test/ICSharpCode.SharpZipLib.Tests/GZip/GZipTests.cs
  69. +7 −7 test/ICSharpCode.SharpZipLib.Tests/Lzw/LzwTests.cs
  70. +59 −37 test/ICSharpCode.SharpZipLib.Tests/Tar/TarTests.cs
  71. +4 −13 test/ICSharpCode.SharpZipLib.Tests/TestSupport/PerformanceTesting.cs
  72. +112 −68 test/ICSharpCode.SharpZipLib.Tests/TestSupport/RingBuffer.cs
  73. +48 −25 test/ICSharpCode.SharpZipLib.Tests/TestSupport/Streams.cs
  74. +3 −5 test/ICSharpCode.SharpZipLib.Tests/TestSupport/StringTesting.cs
  75. +13 −15 test/ICSharpCode.SharpZipLib.Tests/TestSupport/Utils.cs
  76. +4 −3 test/ICSharpCode.SharpZipLib.Tests/TestSupport/ZipTesting.cs
  77. +61 −38 test/ICSharpCode.SharpZipLib.Tests/Zip/FastZipHandling.cs
  78. +140 −77 test/ICSharpCode.SharpZipLib.Tests/Zip/GeneralHandling.cs
  79. +44 −25 test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs
  80. +38 −17 test/ICSharpCode.SharpZipLib.Tests/Zip/WindowsNameTransformHandling.cs
  81. +7 −11 test/ICSharpCode.SharpZipLib.Tests/Zip/ZipEncryptionHandling.cs
  82. +17 −10 test/ICSharpCode.SharpZipLib.Tests/Zip/ZipEntryFactoryHandling.cs
  83. +11 −9 test/ICSharpCode.SharpZipLib.Tests/Zip/ZipEntryHandling.cs
  84. +78 −34 test/ICSharpCode.SharpZipLib.Tests/Zip/ZipExtraDataHandling.cs
  85. +173 −92 test/ICSharpCode.SharpZipLib.Tests/Zip/ZipFileHandling.cs
  86. +13 −7 test/ICSharpCode.SharpZipLib.Tests/Zip/ZipNameTransformHandling.cs
  87. +143 −78 test/ICSharpCode.SharpZipLib.Tests/Zip/ZipTests.cs
@@ -9,58 +9,69 @@ namespace ICSharpCode.SharpZipLib.BZip2
public static class BZip2
{
/// <summary>
/// Decompress the <paramref name="inStream">input</paramref> writing
/// Decompress the <paramref name="inStream">input</paramref> writing
/// uncompressed data to the <paramref name="outStream">output stream</paramref>
/// </summary>
/// <param name="inStream">The readable stream containing data to decompress.</param>
/// <param name="outStream">The output stream to receive the decompressed data.</param>
/// <param name="isStreamOwner">Both streams are closed on completion if true.</param>
public static void Decompress(Stream inStream, Stream outStream, bool isStreamOwner)
{
if (inStream == null || outStream == null) {
if (inStream == null || outStream == null)
{
throw new Exception("Null Stream");
}
try {
using (BZip2InputStream bzipInput = new BZip2InputStream(inStream)) {
try
{
using (BZip2InputStream bzipInput = new BZip2InputStream(inStream))
{
bzipInput.IsStreamOwner = isStreamOwner;
Core.StreamUtils.Copy(bzipInput, outStream, new byte[4096]);
}
} finally {
if (isStreamOwner) {
}
finally
{
if (isStreamOwner)
{
// inStream is closed by the BZip2InputStream if stream owner
outStream.Dispose();
}
}
}
/// <summary>
/// Compress the <paramref name="inStream">input stream</paramref> sending
/// Compress the <paramref name="inStream">input stream</paramref> sending
/// result data to <paramref name="outStream">output stream</paramref>
/// </summary>
/// <param name="inStream">The readable stream to compress.</param>
/// <param name="outStream">The output stream to receive the compressed data.</param>
/// <param name="isStreamOwner">Both streams are closed on completion if true.</param>
/// <param name="level">Block size acts as compression level (1 to 9) with 1 giving
/// <param name="level">Block size acts as compression level (1 to 9) with 1 giving
/// the lowest compression and 9 the highest.</param>
public static void Compress(Stream inStream, Stream outStream, bool isStreamOwner, int level)
{
if (inStream == null || outStream == null) {
if (inStream == null || outStream == null)
{
throw new Exception("Null Stream");
}
try {
using (BZip2OutputStream bzipOutput = new BZip2OutputStream(outStream, level)) {
try
{
using (BZip2OutputStream bzipOutput = new BZip2OutputStream(outStream, level))
{
bzipOutput.IsStreamOwner = isStreamOwner;
Core.StreamUtils.Copy(inStream, bzipOutput, new byte[4096]);
}
} finally {
if (isStreamOwner) {
}
finally
{
if (isStreamOwner)
{
// outStream is closed by the BZip2OutputStream if stream owner
inStream.Dispose();
}
}
}
}
}
@@ -66,7 +66,7 @@ internal sealed class BZip2Constants
/// <summary>
/// When multiplied by compression parameter (1-9) gives the block size for compression
/// 9 gives the best compression but uses the most memory.
/// </summary>
/// </summary>
public const int BaseBlockSize = 100000;
/// <summary>
Oops, something went wrong.

0 comments on commit 433e2f4

Please sign in to comment.