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 bytesToHexWithSpaces(byte[] bytes) {
        StringBuilder newString = new StringBuilder();
        for (int i = 0; i < bytes.length; i++) {
            String byteHex = String.format("%02X", (byte) bytes[i]);
            newString.append(byteHex).append(" ");

        }
        return newString.toString().trim();

    }
}