
Var twoCharacterBuffer = new StringBuilder() įoreach (var character in hexString.Where(c => c != ' ')) Private void WriteHexStringToFile(string hexString, FileStream stream) WriteHexStringToFile(Content.Text, stream) Replace over such a long string doesn't help. Private byte Hex_to_ByteArray(string s)īuffer = (byte)Convert.ToByte(s.Substring(i, 2), 16) Stream.Write(Hex_to_ByteArray(hexString), 0, Hex_to_ByteArray(hexString).Length) String hexString = () įileStream stream = new FileStream(save_log.FileName, FileMode.Create, FileAccess.ReadWrite) Determine if the user selected a file name from the saveFileDialog. Save_log.Filter = "Binary File (*.bin)|*.bin" SaveFileDialog save_log = new SaveFileDialog()

How can I solve this? Here is my code: private void btn_Save_Click(object sender, EventArgs e) If data is big (maybe > 20mb) it throws an out of memory error.

Finally, I saved all data to a binary file. I wrote one app using C# to read data from a serial port and show the data on a textbox in hex string format.
