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 bytesToString(byte[] bytes, int offset, int strLength) {
        byte[] stringBytes = new byte[strLength];
        System.arraycopy(bytes, offset, stringBytes, 0, strLength);
        //      return new String(Arrays.copyOfRange(bytes, offset, offset + strLength)).trim();
        return new String(stringBytes).trim();

    }
}