/* * Decompiled with CFR 0.0. * * Could not load the following classes: * java.lang.Integer * java.lang.Object * java.util.ArrayList * java.util.Collection * java.util.List */ package com.juntek.celiangvat.util; import com.juntek.celiangvat.util.BCDCode; import com.juntek.celiangvat.util.Command; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class BCDUtil { public static /* varargs */ byte[] getCommandBytes(Command ... arrcommand) { ArrayList arrayList = new ArrayList(); arrayList.add((Object)187); int n = arrcommand.length; int n2 = 0; for (int i = 0; i < n; ++i) { Command command = arrcommand[i]; arrayList.addAll(BCDUtil.intToBCD(command.num)); arrayList.add((Object)command.command); } int n3 = 0; for (int i = 0; i < arrayList.size(); ++i) { n3 += ((Integer)arrayList.get(i)).intValue(); } arrayList.add((Object)BCDCode.normalDecToHex(n3 % 100)); arrayList.add((Object)238); byte[] arrby = new byte[arrayList.size()]; while (n2 < arrayList.size()) { arrby[n2] = (byte)((Integer)arrayList.get(n2)).intValue(); ++n2; } return arrby; } public static List intToBCD(int n) { if (n == 0) { ArrayList arrayList = new ArrayList(); arrayList.add((Object)0); return arrayList; } ArrayList arrayList = new ArrayList(); while (n > 0) { int n2 = n % 100; n /= 100; arrayList.add((Object)BCDCode.normalDecToHex(n2)); } ArrayList arrayList2 = new ArrayList(); for (int i = -1 + arrayList.size(); i >= 0; --i) { arrayList2.add(arrayList.get(i)); } return arrayList2; } public static byte[] query(int n) { byte[] arrby = new byte[]{-69, -102, (byte)n, BCDCode.decToHex((n + 341) % 100), -18}; return arrby; } }