Here you can find the source of int2TwoChars(int i)
Parameter | Description |
---|---|
i | a parameter |
public static char[] int2TwoChars(int i)
//package com.java2s; //License from project: LGPL public class Main { /**//from w w w .j a va2s .c o m * Converts an int into an array of two characters with the high bits * in the first element and the low bits in the second element * @param i * @return */ public static char[] int2TwoChars(int i) { char[] asChars = new char[2]; asChars[0] = (char) (i >>> 16); asChars[1] = (char) (i & 0xFFFF); return asChars; } }