本文介绍了是java字节与C#字节相同吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果输入参数是字节数组 - byte [],dll的Native方法在java中工作。
如果我们从c#使用相同的方法,它会抛出EntryPointNotFoundException。
Native method from dll works in java if the input parameter is array of bytes - byte[].If we use the same method from c# it throws EntryPointNotFoundException.
这是因为java和c#中的byte []是不同的?如果这样我应该如何使用C#中的本机函数?
Is that because of byte[] in java and c# are different things? and if it's so how should I use native function from c#?
推荐答案
Java缺少无符号类型。特别地,Java缺少无符号字节的基本类型。 Java字节类型被签名,而C#字节是无符号且sbyte被签名。
Java lacks the unsigned types. In particular, Java lacks a primitive type for an unsigned byte. The Java byte type is signed, while the C# byte is unsigned and sbyte is signed.
这篇关于是java字节与C#字节相同吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!