(int input)
| 154 | |
| 155 | /* Based on http://snippets.dzone.com/posts/show/93 */ |
| 156 | public static byte[] intToByteArray(int input) |
| 157 | { |
| 158 | byte[] out = new byte[4]; |
| 159 | for (int i = 0; i < 4; i++) { |
| 160 | int offset = (out.length - 1 - i) * 8; |
| 161 | out[i] = (byte) ((input >>> offset) & 0xFF); |
| 162 | } |
| 163 | return out; |
| 164 | } |
| 165 | |
| 166 | /* Based on http://snippets.dzone.com/posts/show/93 */ |
| 167 | public static int byteArrayToInt(byte[] data) |
nothing calls this directly
no outgoing calls
no test coverage detected