Is there any reason you can't just manually pack the bytes together?

public int getInt(byte[]buf, int ix){
    return buf[ix] | buf[ix + 1] << 8 | buf[ix + 2] << 16 | buf[ix + 3] << 
24;
}

It should be kind of slow but probably less so than a bunch of allocations

-- 
You received this message because you are subscribed to the Google Groups 
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to