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 getHexString(byte[] raw) {
        String str = new String();

        for (byte b : raw) {
            String hex = Integer.toHexString(b & 0xFF);

            if (hex.length() == 1) {
                str += "0" + hex;
            } else {
                str += hex;
            }
        }

        return str;
    }
}