/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
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; }
/** * 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(); } }
Assert.checkArrayBounds(array, offs, len); for (int i = 0; i < len; i ++) { ByteBuffer buffer = array[offs + i];
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
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; }
/** * 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(); } }