2.4 Scattering Reads

简介: 2.4 Scattering Reads

分散读取,有一个文本文件 3parts.txt

onetwothree

使用如下方式读取,可以将数据填充至多个 buffer

try (RandomAccessFile file = new RandomAccessFile("helloword/3parts.txt", "rw")) { FileChannel channel = file.getChannel(); ByteBuffer a = ByteBuffer.allocate(3); ByteBuffer b = ByteBuffer.allocate(3); ByteBuffer c = ByteBuffer.allocate(5); channel.read(new ByteBuffer[]{a, b, c}); a.flip(); b.flip(); c.flip(); debug(a); debug(b); debug(c); } catch (IOException e) { e.printStackTrace(); }


目录
相关文章
|
8月前
PGA memory operation
PGA memory operation
126 1
2.5 Gathering Writes
2.5 Gathering Writes
81 0
|
关系型数据库 MySQL
Consistent Nonlocking Reads,Locking Reads 和Phantom Rows
以Consistent Nonlocking Reads,Locking Reads为突破点,用简单的例子来说明mysql常用的事务隔离级别(READ COMMITTED, REPEATABLE READ)和lock(record lock,gap lock,next-key lock, Insert Intention Lock)的关系
Consistent Nonlocking Reads,Locking Reads 和Phantom Rows
|
Oracle 关系型数据库 数据库
20171110_allow_read_only_corruption参数
[20171110]_allow_read_only_corruption参数.txt --//昨天在修改查询隐含参数脚本时发现一个参数_allow_read_only_corruption,感觉应该可以在异常关闭的情况下以read only打开.
1220 0