Skip to content

Instantly share code, notes, and snippets.

@cnd
Created November 7, 2012 13:10
Show Gist options
  • Save cnd/4031506 to your computer and use it in GitHub Desktop.
Save cnd/4031506 to your computer and use it in GitHub Desktop.
byte[] cmd = { 0x0F, 0xB1 };
byte[] luas = Encoding.ASCII.GetBytes(luaTextBox.Text);
int newSize = cmd.Length + luas.Length;
using (var ms = new MemoryStream(new byte[newSize], 0, newSize, true, true)) {
ms.Write(cmd, 0, cmd.Length);
ms.Write(luas, 0, luas.Length);
byte[] merged = ms.GetBuffer();
Core.ncon.Send(merged);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment