/// <summary> /// Write a string value to the binary rom image. /// </summary> /// <param name="mdString">The value to write.</param> public void writeString(MDString mdString) { //move to the correct position this.setStreamPosition(this.writer.BaseStream, mdString.Address); //convert to bytes char[] chars = mdString.CurrentValue.ToCharArray(); int length = chars.Length; byte[] bytes = new byte[length]; for (int index = 0; index < length; index++) { bytes[index] = (byte)chars[index]; } //write the bytes this.writer.Write(bytes, 0, length); }
/// <summary> /// Write a string value to the binary rom image. /// </summary> /// <param name="mdString">The value to write.</param> /// <param name="stringTerminator">The byte to append at the end of the string to represent the end of the string.</param> public void writeString(MDString mdString, byte stringTerminator) { this.writeString(mdString); //write the string terminator this.writer.Write(stringTerminator); }