(int input)
| 206 | |
| 207 | /* Based on http://snippets.dzone.com/posts/show/93 */ |
| 208 | public static byte[] intToByteArray(int input) |
| 209 | { |
| 210 | byte[] out = new byte[4]; |
| 211 | for (int i = 0; i < 4; i++) { |
| 212 | int offset = (out.length - 1 - i) * 8; |
| 213 | out[i] = (byte) ((input >>> offset) & 0xFF); |
| 214 | } |
| 215 | return out; |
| 216 | } |
| 217 | |
| 218 | /* Based on http://snippets.dzone.com/posts/show/93 */ |
| 219 | public static int byteArrayToInt(byte[] data) |
no outgoing calls
no test coverage detected