Here you can find the source of fromInt(int intValue)
Parameter | Description |
---|---|
intValue | The int to interpret to binary |
public static byte[] fromInt(int intValue)
//package com.java2s; /*/*w w w .ja v a 2s . com*/ * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ public class Main { /** * Interpret an int as its binary form * * @param intValue The int to interpret to binary * * @return The binary */ public static byte[] fromInt(int intValue) { byte[] bytes = new byte[4]; bytes[0] = (byte) (intValue >> 24); bytes[1] = (byte) ((intValue << 8) >> 24); bytes[2] = (byte) ((intValue << 16) >> 24); bytes[3] = (byte) ((intValue << 24) >> 24); return bytes; } }