Write Utf8 String using BinaryWriter - CSharp System.IO

CSharp examples for System.IO:BinaryWriter

Description

Write Utf8 String using BinaryWriter

Demo Code


using System.Text;
using System.IO;/*from  w  ww  . j a  va  2 s.co  m*/

public class Main{
        public static void WriteUtf8String(this BinaryWriter bw, string str)
        {
            bw.Write(Encoding.UTF8.GetBytes(str));
            bw.Write((byte)0);
        }
}

Related Tutorials