前两天发在JavaSE区发现没人解答,不知道是不是没有被大神们注意到,再发一帖吧。代码段来自AOSP源码android.os.Parcel类:
/**
* Write a byte array into the parcel at the current {@link #dataPosition},
* growing {@link #dataCapacity} if needed.
* @param b Bytes to place into the parcel.
* @param offset Index of first byte to be written.
* @param len Number of bytes to write.
*/
public final void writeByteArray(byte[] b, int offset, int len) {
if (b == null) {
writeInt(-1);
return;
}
Arrays.checkOffsetAndCount(b.length, offset, len);
nativeWriteByteArray(mNativePtr, b, offset, len);
}Arrays类引用自java.util.Arrayscompile报错,楼主查找了下本地jdk1.7及jdk1.8中的java.util.Arrays类均未找到方法Arrays.checkOffsetAndCount(int, int, int)麻烦大神指点下, 不胜感激。
/**
* Write a byte array into the parcel at the current {@link #dataPosition},
* growing {@link #dataCapacity} if needed.
* @param b Bytes to place into the parcel.
* @param offset Index of first byte to be written.
* @param len Number of bytes to write.
*/
public final void writeByteArray(byte[] b, int offset, int len) {
if (b == null) {
writeInt(-1);
return;
}
Arrays.checkOffsetAndCount(b.length, offset, len);
nativeWriteByteArray(mNativePtr, b, offset, len);
}Arrays类引用自java.util.Arrayscompile报错,楼主查找了下本地jdk1.7及jdk1.8中的java.util.Arrays类均未找到方法Arrays.checkOffsetAndCount(int, int, int)麻烦大神指点下, 不胜感激。
首先非常感谢回答。一度以为CSDN无人来访了
代码段是package android.os 下面的Parcel类 可google查询一下
大分类在/platform/framework下面