Java Byte Array Add addBytes(byte[][] src)

Here you can find the source of addBytes(byte[][] src)

Description

add Bytes

License

Apache License

Declaration

public static byte[] addBytes(byte[][] src) 

Method Source Code

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

public class Main {
    public static byte[] addBytes(byte[][] src) {
        int length = 0;
        for (int i = 0; i < src.length; i++) {
            if (src[i] != null)
                length += src[i].length;
        }//from  w  w  w  .  j  a  v a  2  s . co  m
        byte[] score = new byte[length];
        int index = 0;
        for (int i = 0; i < src.length; i++) {
            if (src[i] != null) {
                System.arraycopy(src[i], 0, score, index, src[i].length);
                index += src[i].length;
            }
        }
        src = (byte[][]) null;
        return score;
    }
}

Related

  1. addByteArrays(byte[] array1, byte[] array2)
  2. addByteArrays(byte[]... arrays)
  3. addBytes(byte[] array, byte[] value)
  4. addBytes(byte[] initBytes, byte[] addBytes)
  5. appendByte(byte[] bytes, byte b)
  6. appendByte(byte[] bytes, byte b)