read byte array from C# that is written from Java
问题 I am trying to write an Integer from C# and read it from Java. An integer is 4 bytes in both languages. However when I write it from C#, integer 1 is written in the following bytes 1000. Meaning the first byte is 1 and the rest is 0. But in Java the same thing is written as 0001. Meaing the first 3 bytes are 0 and the last is 1. Is there a simple way of reading and writing among these languages instead of manually reversing every 4 byte? The code for Java ByteBuffer buffer = ByteBuffer