public static void AddByte(this MemoryStream stream, sbyte value) { byte result; if (value == -1) result = 0xFF; else result = Convert.ToByte(value); stream.AddBytes(new[] { result }); }
public static void AddByte(this MemoryStream stream, byte value) { stream.AddBytes(new[] { value }); }