Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**
     * Return an integer representation of a BCD array.
     */
    public static int bcdArrayToInt(byte[] bcdArray) {
        StringBuilder decimalString = new StringBuilder();

        for (Byte b : bcdArray) {
            decimalString.append(String.format("%02X", b));
        }

        return Integer.valueOf(decimalString.toString());
    }
}