// Initialize empty chunk public PNGChunk(string Type) { Length = 0; this.Type = Type; Data = new byte[0]; CRC = CRCCalculator.CalculateCRC(Type, Data); }
// Initialize from scratch public PNGChunk(string Type, byte[] data) { Length = (uint)data.Length; this.Type = Type; Data = data; CRC = CRCCalculator.CalculateCRC(Type, data); }