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 getStr(byte[] b, int index) {
        int i;
        for (i = index; i < b.length; i++) {
            if (b[i] == 0)
                break;
        }
        if (i == index)
            return "";
        byte[] str = new byte[i - index];
        System.arraycopy(b, index, str, 0, i - index);
        return new String(str);
    }
}