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;

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

    public static byte[] toSimpleBytes(Byte[] bytes) {
        byte[] simpleBytes = new byte[bytes.length];
        for (int i = 0; i < bytes.length; i++) {
            simpleBytes[i] = bytes[i];
        }
        return simpleBytes;
    }
}