Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static byte[] combBytes(byte[]... bytes) {
        int length = 0;
        for (int i = 0; i < bytes.length; i++) {
            length = length + (bytes[i] != null ? bytes[i].length : 0);
        }
        byte[] combBytes = new byte[length];
        int position = 0;
        for (int i = 0; i < bytes.length; i++) {
            System.arraycopy(bytes[i], 0, combBytes, position, bytes[i].length);
            position = position + bytes[i].length;
        }
        return combBytes;
    }
}