Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;

import java.util.List;
import java.util.Objects;

public class Main {

    private static List<Byte> asList(byte[] bytes) {
        Objects.requireNonNull(bytes);

        if (bytes.length == 0) {
            return new ArrayList<>();
        }

        final List<Byte> list = new ArrayList<>(bytes.length);
        for (byte b : bytes) {
            list.add(b);
        }
        return list;
    }
}