Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Formatter;

public class Main {
    public static String hexEncode(byte[] in) {
        StringBuilder builder = new StringBuilder(in.length * 2);

        Formatter formatter = new Formatter(builder);
        for (byte inByte : in) {
            formatter.format("%02x", inByte);
        }

        return builder.toString();
    }
}