Converts an int to 4 bytes java representation.
(int c)
| 272 | |
| 273 | /** Converts an int to 4 bytes java representation. */ |
| 274 | public static byte[] getIntBytes(int c) { |
| 275 | byte b[] = new byte[4]; |
| 276 | b[0] = (byte) ((c & 0xff)); |
| 277 | b[1] = (byte) ((c >>> 8) & 0xff); |
| 278 | b[2] = (byte) ((c >>> 16) & 0xff); |
| 279 | b[3] = (byte) ((c >>> 24) & 0xff); |
| 280 | return b; |
| 281 | } |
| 282 | |
| 283 | /** Converts an 4 bytes java int representation to an int. */ |
| 284 | public static int getInt(byte b[]) { |
no outgoing calls
no test coverage detected