public static boolean isOutOfBounds(int index, int length, int capacity) {
return (index | length | (index + length) | (capacity - (index + length))) < 0;
}
标签:city iso return ret static byte netty pos div
public static boolean isOutOfBounds(int index, int length, int capacity) {
return (index | length | (index + length) | (capacity - (index + length))) < 0;
}
验证一个数组(buffer)中 capacity,index,length 是否合法的方法(代码来自Netty 的byteBuf)
标签:city iso return ret static byte netty pos div
原文地址:https://www.cnblogs.com/foxhasdream/p/8679163.html