Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String bytes2HexString(byte[] paramArrayOfByte) {
        String str1 = "";
        for (int i = 0;; i++) {
            if (i >= paramArrayOfByte.length) {
                return str1;
            }
            String str2 = Integer.toHexString(0xFF & paramArrayOfByte[i]);
            if (str2.length() == 1) {
                str2 = '0' + str2;
            }
            str1 = str1 + str2;
        }
    }
}