Merge three byte array - Android File Input Output

Android examples for File Input Output:Byte Array

Description

Merge three byte array

Demo Code


//package com.java2s;

public class Main {
    public static byte[] byteCase(byte[] byte_1, byte[] byte_2,
            byte[] byte_3) {
        byte[] byteTotal = new byte[byte_1.length + byte_2.length
                + byte_3.length];

        System.arraycopy(byte_1, 0, byteTotal, 0, byte_1.length);
        System.arraycopy(byte_2, 0, byteTotal, byte_1.length, byte_2.length);
        System.arraycopy(byte_3, 0, byteTotal, byte_1.length
                + byte_2.length, byte_3.length);

        return byteTotal;
    }/*from ww w .j  a  v  a  2  s  . c  om*/
}

Related Tutorials