android CVArrays
来源:互联网 发布:plc控制电机正反转编程 编辑:程序博客网 时间:2024/06/06 01:39
import java.lang.reflect.Array;class CVArrays { /** * Copies elements from {@code original} into a new array, from indexes start (inclusive) to * * @param original the original array * @param start the start index, inclusive * @param end the end index, exclusive * @return the new array * @throws ArrayIndexOutOfBoundsException if {@code start < 0 || start > original.length} * @throws IllegalArgumentException if {@code start > end} * @throws NullPointerException if {@code original == null} * @since 1.6 */ @SuppressWarnings("unchecked") public static <T> T[] copyOfRange(T[] original, int start, int end) { int originalLength = original.length; // For exception priority compatibility. if (start > end) { throw new IllegalArgumentException(); } if (start < 0 || start > originalLength) { throw new ArrayIndexOutOfBoundsException(); } int resultLength = end - start; int copyLength = Math.min(resultLength, originalLength - start); T[] result = (T[]) Array.newInstance(original.getClass().getComponentType(), resultLength); System.arraycopy(original, start, result, 0, copyLength); return result; }}
0 0
- android CVArrays
- Android
- android
- Android
- android
- android
- Android
- Android
- android
- android
- android
- Android
- Android
- android!!!
- android
- android
- android
- android
- java向上转型和向下转型
- [LeetCode] Rotate List
- nagios 安装配置(包括nrpe端)全 (五)
- java.lang.NoClassDefFoundError: org/objectweb/asm/Type 错误
- Oracle体系结构
- android CVArrays
- Android权限之packages.xml解析
- 聊聊高并发(七)实现几种自旋锁(二)
- Android recovery UI实现分析
- Launcher源码学习记录(一)
- Java数字的格式化
- iOS 判断文件下载的文件类型
- 准备开始写博客了
- 控制台编程笔记