Java Char Array to Int charsToInt(char[] chars, int offset)

Here you can find the source of charsToInt(char[] chars, int offset)

Description

chars To Int

License

Open Source License

Declaration

static int charsToInt(char[] chars, int offset) 

Method Source Code

//package com.java2s;
/*//from   ww w.j  av  a  2 s  .c om
 *
 *  The contents of this file are subject to the Terracotta Public License Version
 *  2.0 (the "License"); You may not use this file except in compliance with the
 *  License. You may obtain a copy of the License at
 *
 *  http://terracotta.org/legal/terracotta-public-license.
 *
 *  Software distributed under the License is distributed on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 *  the specific language governing rights and limitations under the License.
 *
 *  The Covered Software is Terracotta Core.
 *
 *  The Initial Developer of the Covered Software is
 *  Terracotta, Inc., a Software AG company
 *
 */

public class Main {
    static int charsToInt(char[] chars, int offset) {
        int high = (chars[offset] << 16);
        return high + chars[offset + 1];
    }
}

Related

  1. charArrayDecimalToInt(char[] str, int start, int len, int mul)
  2. charArrayDigitToInt(char[] str, int start, int len)
  3. charArrayHexToInt(char[] str, int start, int len)
  4. charArrayToInt(char[] data, int start, int length, int[] end)