I want to do the equivalent of this:
byte[] byteArray; enum commands : byte {one, two}; commands content = one; byteArray = (byte*)&content;
The BitConverter class might be what you are looking for. Example:
int input = 123; byte[] output = BitConverter.GetBytes(input);
If your enum was known to be an Int32 derived type, you could simply cast its values first:
BitConverter.GetBytes((int)commands.one);