Here you can find the source of length(byte[] array)
public static int length(byte[] array)
//package com.java2s; //License from project: Apache License public class Main { public static int length(byte[] array) { return (array == null ? 0 : array.length); }/*ww w . j a v a 2 s. c o m*/ public static int length(byte[]... arrays) { int len = 0; if (arrays != null) { for (byte[] array : arrays) { if (array != null) { len += array.length; } } } return len; } }