Here you can find the source of toByteArray(final int value)
Parameter | Description |
---|---|
value | the value to convert |
public static byte[] toByteArray(final int value)
//package com.java2s; //License from project: Apache License public class Main { /**/* w w w.j a va 2 s .com*/ * Method used to convert integer to byet array * * @param value * the value to convert * @return a byte array */ public static byte[] toByteArray(final int value) { return new byte[] { // (byte) (value >> 24), // (byte) (value >> 16), // (byte) (value >> 8), // (byte) value // }; } }