/// <summary> /// Writes a <see cref="IccCrdInfoTagDataEntry"/> /// </summary> /// <param name="value">The entry to write</param> /// <returns>The number of bytes written</returns> public int WriteCrdInfoTagDataEntry(IccCrdInfoTagDataEntry value) { int count = 0; WriteString(value.PostScriptProductName); WriteString(value.RenderingIntent0Crd); WriteString(value.RenderingIntent1Crd); WriteString(value.RenderingIntent2Crd); WriteString(value.RenderingIntent3Crd); return(count); void WriteString(string text) { int textLength; if (string.IsNullOrEmpty(text)) { textLength = 0; } else { textLength = text.Length + 1; // + 1 for null terminator } count += this.WriteUInt32((uint)textLength); count += this.WriteAsciiString(text, textLength, true); } }
internal void ReadCrdInfoTagDataEntry(byte[] data, IccCrdInfoTagDataEntry expected) { IccDataReader reader = CreateReader(data); IccCrdInfoTagDataEntry output = reader.ReadCrdInfoTagDataEntry(); Assert.Equal(expected, output); }
internal void WriteCrdInfoTagDataEntry(byte[] expected, IccCrdInfoTagDataEntry data) { IccDataWriter writer = CreateWriter(); writer.WriteCrdInfoTagDataEntry(data); byte[] output = writer.GetData(); Assert.Equal(expected, output); }