Forgive if this question is incredibly poorly phrased, but I'll do my best to explain what is (to me) a rather complex situation. I am fully aware that I am in way over my head here, experience wise, but I am hoping one of you can help me.
I come to you brighter minds with this, because I am in a complete rut and there appears to be no light at the end of the tunnel.
I have a file I wish converted with C# to a byte array, because the byte array will be sent as an argument into a Java method.
So I thought:
byte[] a = System.IO.File.ReadAllBytes(filePathHere);
Now, this works, and all is peaceful in the world. But the problem arises when i try to send a into my Java method.
The error it throws me when i try to send this to my Java file by means of JSON is:
org.codehaus.jackson.JsonParseException: Numeric value (181) out of range of Java byte
Now, after some (in vain) Googling, I came to the conclusion that C# thinks its being helpful by converting the file into a byte array that contains items with value between 0 and 255.
While Java is expecting to get as an argument for my method is a byte array with values reaching from -128 to 128.
In an ideal world, I would love it if any of you knew how to convert my file C# into a byte array with values reaching from -128 to 128.
However, if this is in fact impossible, I would also be open to, in Java, converting my byte array with value between 0 and 255 to a more desired -128 to 128 format.
Is what I describe impossible, or does someone know how this can be done?
I deeply appreciate any help anyone can provide. The more detailed and noob-friendly, the better!