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 toHexString(byte[] bytes) {
        StringBuffer buffer = new StringBuffer();
        for (byte i : bytes) {
            buffer.append(Character.forDigit((i >> 4) & 0xF, 16));
            buffer.append(Character.forDigit((i & 0xF), 16));
        }

        return buffer.toString();
    }
}