Arrays.checkOffsetAndCount方法jdk中没有找到

萧乡月夜 2016-08-24 03:08:44
/**
* 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.checkOffsetAndCount(int, int, int)方法没有在jdk 中找到,求解,谢谢。
...全文
378 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
萧乡月夜 2016-08-26
  • 打赏
  • 举报
回复
CSDN大神们呢。。有人知道原因么????
萧乡月夜 2016-08-24
  • 打赏
  • 举报
回复
别沉啊 来人啊
萧乡月夜 2016-08-24
  • 打赏
  • 举报
回复
引用 3 楼 qnmdcsdn 的回复:
看一下是哪个包下的Arrays,点进去跟踪一下这个方法
就是java.util.Arrays jdk1.7, 1.8 都看了, 没找到 代码段是AOSP里的
  • 打赏
  • 举报
回复
看一下是哪个包下的Arrays,点进去跟踪一下这个方法
萧乡月夜 2016-08-24
  • 打赏
  • 举报
回复
谢谢 好久没发了 忘记了。 代码重新贴一下:
    
/**
     * 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);
    }
捏造的信仰 2016-08-24
  • 打赏
  • 举报
回复
楼主要学会贴代码
public class Demo {
    public static void main(String[] args) {
        if (args.length == 0) {
            System.out.println("no args.");
        }
    }
}
像楼主的代码层级多,又没有排版,没法看。

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧