@TargetApi(Build.VERSION_CODES.GINGERBREAD) public static byte[] copyOf(byte[] original,int newLength){
  byte[] copy;
  if (Utils.hasGingerbread()) {
    copy=Arrays.copyOf(original,newLength);
  }
 else {
    copy=new byte[newLength];
    System.arraycopy(original,0,copy,0,Math.min(original.length,newLength));
  }
  return copy;
}

@ TargetApi ( Build . VERSION_CODES . GINGERBREAD ) public static byte [ ] copyOf ( byte [ ] original , int newLength ) { byte [ ] copy ; if ( Utils . hasGingerbread ( ) ) { copy = Arrays . copyOf ( original , newLength ) ; } else { copy = new byte [ newLength ] ; System . arraycopy ( original , 0 , copy , 0 , Math . min ( original . length , newLength ) ) ; } return copy ; }
arrays . copyof ( byte [ ] original , int newlength ) not found in api < = 8 . copies the specified array , truncating or padding with zeros ( if necessary ) so the copy has the specified length . for all indices that are valid in both the original array and the copy , the two arrays will contain identical values . for any indices that are valid in the copy but not the original , the copy will contain ( byte ) 0 . such indices will exist if and only if the specified length is greater than that of the original array .
