CSharpImageLibrary.Headers.PNG_Header.PNGChunk.PNGChunk C# (CSharp) Method

PNGChunk() public method

Reads a PNG header chunk.
public PNGChunk ( byte headerBlock, int offset = 8 ) : System
headerBlock byte Block of data containing headers.
offset int Offset in data to begin header.
return System
            public PNGChunk(byte[] headerBlock, int offset = 8)
            {
                Length = MyBitConverter.ToInt32(headerBlock, offset, MyBitConverter.Endianness.BigEndian);
                ChunkType = MyBitConverter.ToInt32(headerBlock, offset + 4, MyBitConverter.Endianness.BigEndian);
                ChunkData = new byte[Length];
                Array.Copy(headerBlock, offset + 8, ChunkData, 0, Length);
                CRC = MyBitConverter.ToInt32(headerBlock, offset + 8 + Length, MyBitConverter.Endianness.BigEndian);
            }
PNG_Header.PNGChunk