I would like to convert a signed int into a signed byte[] array, and later convert it back into a signed int.
However, ByteBuffers (The usual int->buffer->byte[] array) are too slow for this case.
Can this be done using basic operations?
I've seem many attempts, but I haven't seen one that works in all cases. (Usually, they fail for negative numbers.)
I am working in Java, so it is not possible to use unsigned values, even in intermediate steps.
BigInteger? It pulls the sign out of the initial value and then generated abyte[]containing the byte data of the unsigned value.ByteBufferis too slow. Have you done performance tests? If so, what?