diff --git a/src/ImageProcessorCore/Formats/Png/Zlib/ZlibDeflateStream.cs b/src/ImageProcessorCore/Formats/Png/Zlib/ZlibDeflateStream.cs
index a621542007..a2c0ca202f 100644
--- a/src/ImageProcessorCore/Formats/Png/Zlib/ZlibDeflateStream.cs
+++ b/src/ImageProcessorCore/Formats/Png/Zlib/ZlibDeflateStream.cs
@@ -119,7 +119,7 @@ namespace ImageProcessorCore.Formats
{
get
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
}
@@ -128,12 +128,12 @@ namespace ImageProcessorCore.Formats
{
get
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
set
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
}
@@ -146,19 +146,19 @@ namespace ImageProcessorCore.Formats
///
public override int Read(byte[] buffer, int offset, int count)
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
///
public override long Seek(long offset, SeekOrigin origin)
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
///
public override void SetLength(long value)
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
///
diff --git a/src/ImageProcessorCore/Formats/Png/Zlib/ZlibInflateStream.cs b/src/ImageProcessorCore/Formats/Png/Zlib/ZlibInflateStream.cs
index b0afac69cb..4373b5fd17 100644
--- a/src/ImageProcessorCore/Formats/Png/Zlib/ZlibInflateStream.cs
+++ b/src/ImageProcessorCore/Formats/Png/Zlib/ZlibInflateStream.cs
@@ -32,24 +32,6 @@ namespace ImageProcessorCore.Formats
///
private readonly Stream rawStream;
- ///
- /// The preset dictionary.
- /// Merely informational, not used.
- ///
- private bool fdict;
-
- ///
- /// The DICT dictionary identifier identifying the used dictionary.
- /// Merely informational, not used.
- ///
- private byte[] dictId;
-
- ///
- /// CINFO is the base-2 logarithm of the LZ77 window size, minus eight.
- /// Merely informational, not used.
- ///
- private int cinfo;
-
///
/// The read crc data.
///
@@ -60,6 +42,10 @@ namespace ImageProcessorCore.Formats
public ZlibInflateStream(Stream stream)
{
+ // The DICT dictionary identifier identifying the used dictionary.
+
+ // The preset dictionary.
+ bool fdict;
this.rawStream = stream;
// Read the zlib header : http://tools.ietf.org/html/rfc1950
@@ -85,17 +71,19 @@ namespace ImageProcessorCore.Formats
throw new Exception($"Bad compression method for ZLIB header: cmf={cmf}");
}
- this.cinfo = ((cmf & (0xf0)) >> 8);
- this.fdict = (flag & 32) != 0;
+ // CINFO is the base-2 logarithm of the LZ77 window size, minus eight.
+ // int cinfo = ((cmf & (0xf0)) >> 8);
+ fdict = (flag & 32) != 0;
- if (this.fdict)
+ if (fdict)
{
- this.dictId = new byte[4];
+ // The DICT dictionary identifier identifying the used dictionary.
+ byte[] dictId = new byte[4];
for (int i = 0; i < 4; i++)
{
// We consume but don't use this.
- this.dictId[i] = (byte)this.rawStream.ReadByte();
+ dictId[i] = (byte)this.rawStream.ReadByte();
}
}
@@ -117,7 +105,7 @@ namespace ImageProcessorCore.Formats
{
get
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
}
@@ -126,12 +114,12 @@ namespace ImageProcessorCore.Formats
{
get
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
set
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
}
@@ -154,7 +142,7 @@ namespace ImageProcessorCore.Formats
{
// we dont really check/use this
this.crcread[i] = (byte)this.rawStream.ReadByte();
- }
+ }
}
return read;
@@ -163,19 +151,19 @@ namespace ImageProcessorCore.Formats
///
public override long Seek(long offset, SeekOrigin origin)
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
///
public override void SetLength(long value)
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
///
public override void Write(byte[] buffer, int offset, int count)
{
- throw new NotImplementedException();
+ throw new NotSupportedException();
}
///