I use JSON.net to serialize some objects between C# and JavaScript. The JSON data is transfered via WebSocket between the .NET and browser application.
In the data
Simplest way I can think of is to convert the byte array into an integer array, like:
var intArray = byteArray.Select(b => (int)b).ToArray();
This wouldn't require any special handling of the JSON library, or any custom serialization or anything like that.
EDIT: This would mean having to customize your data object to handle the different type. Maybe:
public class CustomFoo : Foo
{
// SomeBytesHere is a byte[] in the base class
public new int[] SomeBytesHere { get;set; }
}
So maybe it's not the simplest - depending on how much stuff you have to serialize