public static Object demuxArray(Object src,int[] dims,Class<?> componentType){
  Object dst=null;
  if (componentType != byte.class) {
    dst=Array.newInstance(componentType,dims);
  }
 else {
    int[] dimsTemp=new int[dims.length + 1];
    System.arraycopy(dims,0,dimsTemp,0,dims.length);
    dimsTemp[dims.length]=1;
    dst=Array.newInstance(componentType,dimsTemp);
  }
  _fillDemux(0,dims,src,0,dst);
  return dst;
}

public static Object demuxArray ( Object src , int [ ] dims , Class < ? > componentType ) { Object dst = null ; if ( componentType != byte . class ) { dst = Array . newInstance ( componentType , dims ) ; } else { int [ ] dimsTemp = new int [ dims . length + 1 ] ; System . arraycopy ( dims , 0 , dimsTemp , 0 , dims . length ) ; dimsTemp [ dims . length ] = 1 ; dst = Array . newInstance ( componentType , dimsTemp ) ; } _fillDemux ( 0 , dims , src , 0 , dst ) ; return dst ; }
demux single - dimension array ( x [ ] ) to a multi - dimension array ( x [ ] [ ] [ ] )
