org.wildfly.common.Assert.checkArrayBounds()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(10.4k)|赞(0)|评价(0)|浏览(160)

本文整理了Java中org.wildfly.common.Assert.checkArrayBounds()方法的一些代码示例,展示了Assert.checkArrayBounds()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.checkArrayBounds()方法的具体详情如下:
包路径:org.wildfly.common.Assert
类名称:Assert
方法名:checkArrayBounds

Assert.checkArrayBounds介绍

[英]Check that the given offset and length fall completely within the bounds of the given array length.
[中]检查给定偏移量和长度是否完全在给定数组长度的范围内。

代码示例

代码示例来源:origin: wildfly/wildfly

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final Object[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final byte[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final char[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final long[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final int[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: wildfly/wildfly

private Object internalCreateContextualProxy(Object instance, Map<String, String> executionProperties,
    Class<?>... interfaces) {
  checkNotNullParam("instance", instance);
  checkArrayBounds(checkNotNullParam("interfaces", interfaces), 0, 1);
  Class<? extends Object> instanceClass = instance.getClass();
  for (Class<? extends Object> thisInterface : interfaces) {
    if (!thisInterface.isAssignableFrom(instanceClass)) {
      throw ROOT_LOGGER.classDoesNotImplementAllInterfaces();
    }
  }
  IdentityAwareProxyInvocationHandler handler = new IdentityAwareProxyInvocationHandler(this, instance, executionProperties);
  Object proxy = Proxy.newProxyInstance(instance.getClass().getClassLoader(), interfaces, handler);
  return proxy;
}

代码示例来源:origin: wildfly/wildfly

/**
 * Bulk-allocate buffers from this pool.  The buffer must be freed through the {@link #free(ByteBuffer)} method.
 *
 * @param array the array of buffers to fill
 * @param offs the offset into the array to fill
 * @param len the number of buffers to fill in the array
 */
public void allocate(ByteBuffer[] array, int offs, int len) {
  Assert.checkNotNullParam("array", array);
  Assert.checkArrayBounds(array, offs, len);
  for (int i = 0; i < len; i ++) {
    array[offs + i] = allocate();
  }
}

代码示例来源:origin: wildfly/wildfly

Assert.checkArrayBounds(array, offs, len);
for (int i = 0; i < len; i ++) {
  ByteBuffer buffer = array[offs + i];

代码示例来源:origin: org.wildfly.common/wildfly-common

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final byte[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final long[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: org.wildfly.common/wildfly-common

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final int[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: org.wildfly.common/wildfly-common

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final Object[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: org.wildfly.common/wildfly-common

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final char[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: org.wildfly.common/wildfly-common

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final long[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final byte[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final int[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final Object[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Check that the given offset and length fall completely within the bounds of the given array.
 *
 * @param array the array to check
 * @param offs the array offset
 * @param len the array length
 * @throws ArrayIndexOutOfBoundsException if the range of the offset and length do not fall within the array bounds
 */
public static void checkArrayBounds(final char[] array, final int offs, final int len) throws ArrayIndexOutOfBoundsException {
  checkNotNullParamChecked("array", array);
  checkArrayBounds(array.length, offs, len);
}

代码示例来源:origin: org.jboss.eap/wildfly-ee

private Object internalCreateContextualProxy(Object instance, Map<String, String> executionProperties,
    Class<?>... interfaces) {
  checkNotNullParam("instance", instance);
  checkArrayBounds(checkNotNullParam("interfaces", interfaces), 0, 1);
  Class<? extends Object> instanceClass = instance.getClass();
  for (Class<? extends Object> thisInterface : interfaces) {
    if (!thisInterface.isAssignableFrom(instanceClass)) {
      throw ROOT_LOGGER.classDoesNotImplementAllInterfaces();
    }
  }
  IdentityAwareProxyInvocationHandler handler = new IdentityAwareProxyInvocationHandler(this, instance, executionProperties);
  Object proxy = Proxy.newProxyInstance(instance.getClass().getClassLoader(), interfaces, handler);
  return proxy;
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Bulk-allocate buffers from this pool.  The buffer must be freed through the {@link #free(ByteBuffer)} method.
 *
 * @param array the array of buffers to fill
 * @param offs the offset into the array to fill
 * @param len the number of buffers to fill in the array
 */
public void allocate(ByteBuffer[] array, int offs, int len) {
  Assert.checkNotNullParam("array", array);
  Assert.checkArrayBounds(array, offs, len);
  for (int i = 0; i < len; i ++) {
    array[offs + i] = allocate();
  }
}

相关文章