Alex Rivera | Logout

is java byte the same as C# byte?

Asked 2011-06-03T04:55:31.473
13

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.

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#?

Edit
Report

1 Answer

6

Is that because of byte[] in java and c# are different things?

Yes.

  • Endianness: Java stores things internally as Big Endian, while .NET is Little Endian by default.
  • Signedness: C# bytes are unsigned. Java bytes are signed.

See different results when converting int to byte array - .NET vs Java.

answered 2011-06-03T04:59:02.793

Your Answer