Returns a big-endian representation of value in a 4-element byte array; equivalent to ByteBuffer.allocate(4).putInt(value).array(). For example, the input value 0x12131415 would yield the byte array {0x12, 0x13, 0x14, 0x15}. If you need to convert and concatenate
(int value)
| 313 | */ |
| 314 | |
| 315 | @GwtIncompatible // doesn't work |
| 316 | public static byte[] toByteArray(int value) { |
| 317 | return new byte[] {(byte) (value >> 24), (byte) (value >> 16), (byte) (value >> 8), (byte) value}; |
| 318 | } |
| 319 | |
| 320 | /** |
| 321 | * Returns the {@code int} value whose big-endian representation is stored in the first 4 bytes of |
no outgoing calls
no test coverage detected