ByteBuffer.allocate()和ByteBuffer.allocateDirect
来源:互联网 发布:淘宝图书经营许可共用 编辑:程序博客网 时间:2024/05/03 12:05
allocateDirectpublic static ByteBuffer allocateDirect(int capacity)分配新的直接字节缓冲区。 新缓冲区的位置将为零,其界限将为其容量,其标记是不确定的。无论它是否具有底层实现数组,其标记都是不确定的。 参数:capacity - 新缓冲区的容量,以字节为单位allocatepublic static ByteBuffer allocate(int capacity)分配一个新的字节缓冲区。 新缓冲区的位置将为零,其界限将为其容量,其标记是不确定的。它将具有一个底层实现数组,且其 数组偏移量将为零。 参数:capacity - 新缓冲区的容量,以字节为单位 allocate和allocateDirect方法都做了相同的工作,不同的是allocateDirect方法直接使用操作系统来分配Buffer。因而它将提供更快的访问速度。不幸的是,并非所有的虚拟机都支持这种直接分配的方法。Sun推荐将以字节为单位的直接型缓冲区allocateDirect用于与大型文件相关并具有较长生命周期的缓冲区。
- ByteBuffer.allocate()和ByteBuffer.allocateDirect
- ByteBuffer的allocate和allocateDirect
- ByteBuffer的allocate和allocateDirect
- ByteBuffer的allocate和allocateDirect
- ByteBuffer的allocate和allocateDirect
- ByteBuffer的allocate和allocateDirect
- ByteBuffer.allocate() vs. ByteBuffer.allocateDirect()
- ByteBuffer的allocate和allocateDirect区别
- ByteBuffer.allocate()和ByteBuffer.allocateDirect在性能上的差异
- ByteBuffer.allocateDirect 与 allocate 方法
- ByteBuffer中allocateDirect与allocate的区别
- ByteBuffer.allocate()与ByteBuffer.allocateDirect()方法的区别。
- ByteBuffer.allocate()/ByteBuffer.allocateDirect()/JNI DETECTED ERROR IN APPLICATION: jarray was NULL
- ByteBuffer.allocate()、BufferUnderflowException Android
- Difference between MappedByteBuffer and ByteBuffer.allocateDirect()
- ByteBuffer
- ByteBuffer
- ByteBuffer
- Coreseek开源中文检索引擎-Sphinx中文版
- Android-OpenGL
- 常用bat命令行
- Linux ALSA声卡驱动之六:ASoC架构中的Machine
- u-boot-2012-07移植二
- ByteBuffer.allocate()和ByteBuffer.allocateDirect
- Linux ALSA声卡驱动之七:ASoC架构中的Codec
- Nginx错误汇总
- js 正则表达式
- apache中vhost的配置文件
- SIP协议
- Linux ALSA声卡驱动之八:ASoC架构中的Platform
- 修改表结构——将字段设置为“可为空”
- javascript 面向对象特性与编程实现