internal virtual byte[] Encode() { var result = new List <byte>(); var dataLength = (uint)Data.Length; var dataCrc = PngCrc.Calculate(InputToCrcCheck()); result.AddRange(dataLength.ToByteArray()); result.AddRange(GetChunkTypeBytes(Type)); result.AddRange(Data); result.AddRange(dataCrc.ToByteArray()); return(result.ToArray()); }
private bool CrcCheck() { var crcInputBytes = InputToCrcCheck(); return(PngCrc.Calculate(crcInputBytes) == Crc); }