Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    protected static String display(byte[] array) {
        char[] val = new char[2 * array.length];
        String hex = "0123456789abcdef";
        for (int i = 0; i < array.length; i++) {
            int b = array[i] & 0xff;
            val[2 * i] = hex.charAt(b >>> 4);
            val[2 * i + 1] = hex.charAt(b & 15);
        }
        return String.valueOf(val);
    }
}