code: public static DataBuffer createShapeInformation(int[] shape, int[] stride, long offset, int elementWiseStride, char order) {
          if (shape.length != stride.length)
              throw new IllegalStateException("Shape and stride must be the same length");
  
          int rank = shape.length;
          int shapeBuffer[] = new int[rank * 2 + 4];
          shapeBuffer[0] = rank;
          int count = 1;
          for (int e = 0; e < shape.length; e++)
              shapeBuffer[count++] = shape[e];
  
          for (int e = 0; e < stride.length; e++)
              shapeBuffer[count++] = stride[e];
  
          shapeBuffer[count++] = (int) offset;
          shapeBuffer[count++] = elementWiseStride;
          shapeBuffer[count] = (int) order;
  
          DataBuffer ret = Nd4j.createBufferDetached(shapeBuffer);
          ret.setConstant(true);
  
          return ret;
      }
docs: Creates the shape information buffer
  given the shape,stride
  @param shape the shape for the buffer
  @param stride the stride for the buffer
  @param offset the offset for the buffer
  @param elementWiseStride the element wise stride for the buffer
  @param order the order for the buffer
  @return the shape information buffer given the parameters