问题
How to convert the following code to C# from Android (Java)?
ByteBuffer bb;
Type = bb.GetInt();
I tried to change this to C# as
Type = bb.Int;
but I am getting wrong values. Please let me know how to convert Java code to C# code
回答1:
See here:
https://developer.xamarin.com/api/type/Java.Nio.ByteBuffer/
You can use
(int)(bb.Get());
Get the value as a sbyte and cast to integer.
来源:https://stackoverflow.com/questions/43117553/conversion-of-bytebuffer-in-xamarin-android