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 toString(byte[] theByteArray) {
        StringBuffer out = new StringBuffer();
        for (int i = 0; i < theByteArray.length; i++) {
            String s = Integer.toHexString(theByteArray[i] & 0xff);
            if (s.length() < 2) {
                out.append('0');
            }
            out.append(s).append(' ');
        }
        return out.toString();
    }
}