Here you can find the source of intToByteArray(int value)
Parameter | Description |
---|---|
value | a parameter |
public static byte[] intToByteArray(int value)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w . j ava2s .c o m * * @param value * @return */ public static byte[] intToByteArray(int value) { byte[] result = new byte[4]; result[3] = (byte) (value >>> 24); result[2] = (byte) (value >>> 16); result[1] = (byte) (value >>> 8); result[0] = (byte) value; return result; } }