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 byteArrayToString(byte[] value, int length) {
        int max = Math.min(length, value.length);
        StringBuilder stringBuilder = new StringBuilder("");
        for (int i = 0; i < max; i++) {
            stringBuilder.append((char) value[i]);
        }
        return stringBuilder.toString();
    }
}