Here you can find the source of twoChars2Int(char ch, char cl)
Parameter | Description |
---|---|
chars | a parameter |
public static int twoChars2Int(char ch, char cl)
//package com.java2s; //License from project: LGPL public class Main { /** //from ww w.j a v a 2 s. co m * Converts two characters two an int number * * @param chars * @return */ public static int twoChars2Int(char ch, char cl) { int l = (ch << 16) + cl; return l; } public static int twoChars2Int(char[] cs) { if (cs.length != 2) { throw new RuntimeException( "Called twoChars2Int with an array that does not have 2 elements but " + cs.length); } return twoChars2Int(cs[0], cs[1]); } }