Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public void writeString(BinaryWriter w, string s)
{
byte[] utf8Bytes = System.Text.Encoding.UTF8.GetBytes(s);
w.Write((UInt32) utf8Bytes.Length);
if(utf8Bytes.Length > 0)
w.Write(utf8Bytes);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment