Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.LinkedList;
import java.util.List;

public class Main {
    public static Byte[] toBytes(List<Byte> listBytes) {
        return toBytes(new LinkedList<Byte>(listBytes));
    }

    public static Byte[] toBytes(LinkedList<Byte> listBytes) {
        Byte[] result = new Byte[listBytes.size()];
        for (int i = 0; i < result.length; i++) {
            result[i] = listBytes.get(i);
        }
        return result;
    }
}