I have C# code that creates an sbyte[ ] and J# code that consumes it. I can't use byte[ ] because Java doesn't support unsigned bytes (lame oversight on Sun's part).
So my problem is this. BinaryWriter has an overload that takes byte[ ], but not sbyte[ ]. Is there a more efficient way to do the following
private
static void WriteFile(string outputFile, sbyte[] bytes){
FileStream outputStream = new FileStream(outputFile, FileMode.Create); BinaryWriter binaryWriter = new BinaryWriter(outputStream); foreach(sbyte element in bytes ){
binaryWriter.Write(element);
}
binaryWriter.Close();
}
Note that this code is on the producer/C# side. (The bytes go to the J# code as well as to a file.)
Thanks,
Brian