Node.js Manual & Documentationnew Buffer(size) o new Buffer(array) o new Buffer(str, encoding='utf8') o buffer.write(string, offset=0, encoding='utf8') o buffer.toString(encoding, start=0, end=buffer.length) o buffer[index] buffer[index] o Buffer.isBuffer(obj) o Buffer.byteLength(string, encoding='utf8') o buffer.length o buffer.copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) o buffer.slice(start slice(start, end=buffer.length) Streams 流 Readable Stream 可读流 o Event: 'data' 事件:'data' o Event: 'end' 事件:'end' o Event: 'error' 事件:'error' o Event: 'close' 事件:'close' o Event: 'fd' 事件:'fd'0 码力 | 153 页 | 1.21 MB | 1 年前3
NodeJS 中文文档 V0.2.3提供了一些方法来创建、操作和接收二进制数据流。 原始的数据保存在 Buffer 类的实例中。Buffer 类似于一个整数数组,不同之处在于它和在 V8内存堆之外分配的 一段内存数据相对应。Buffer 对象的大小不能调整。你可以通过"require('buffer').Buffer"来使用这个类。 Buffer 对象是全局对象。 Buffer 和 Javascirpt 中 string 对象之间的转换需要指定编码方式。如下是 废弃, 应当尽量使用 buffer 对象。这个编码将会在未来的 node 中删除。 � new new new new Buffer(size) Buffer(size) Buffer(size) Buffer(size) 最新版文档:wiki.grati.org QQ 群:53090214 共同学习 NodeJS,欢迎加入。 4 创建指定大小的 buffer 对象。 new new new new new Buffer(array) Buffer(array) Buffer(array) Buffer(array) 从数组新建 buffer 对象。 new new new new Buffer(str, Buffer(str, Buffer(str, Buffer(str, encoding='utf8') encoding='utf8') encoding='utf8') encoding='utf8')0 码力 | 62 页 | 542.14 KB | 1 年前3
2.2.6 字节跳动在 Go 网络库上的实践netpoll gnet easygo (sofa-mosn) evio go net Epoll(ET/LT) LT LT ET/LT LT ET NIO ZeroCopy Buffer Multisyscall 搭建 Netpoll poller epoll_ctl() go epoll_wait() func conns... var 搭建 Netpoll input buffer var output buffer 搭建 Netpoll buffer ? How design ? gopool conn write() read() func hup() poller epoll_ctl() go epoll_wait() func conns... var input buffer var output buffer go go handle() Netpoll buffer ? How design ? gopool conn write() read() func hup() poller epoll_ctl() go epoll_wait() func conns... var input buffer var output buffer go handle() 设计实现 01 性能亮点0 码力 | 42 页 | 3.19 MB | 1 年前3
Java 基础之IO 和NIO 补完Futureoperation = fileChannel.read(buffer, 0); AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(path, StandardOpenOption.READ); ByteBuffer buffer = ByteBuffer.allocate(1024); long long position = 0; Future operation = fileChannel.read(buffer, position); 原文链接:Java 基础之 IO 和 NIO 补完 // Of course, this is not a very efficient use of the CPU - but somehow you need to wait until isDone()); buffer.flip(); byte[] data = new byte[buffer.limit()]; buffer.get(data); System.out.println(new String(data)); buffer.clear(); ● Reading Data Via a CompletionHandler fileChannel.read(buffer, position 0 码力 | 9 页 | 218.38 KB | 1 年前3
MoonBit月兔编程语言 现代编程思想 第十四课 案例:堆栈虚拟机
const 1 end 18 编译程序 利⽤内建 Buffer 数据结构,⽐字符串拼接更⾼效 1. fn Instruction::to_wasm(self : Instruction, buffer : Buffer) -> Unit 2. fn Function::to_wasm(self : Function, buffer : Buffer) -> Unit 3. fn Program::to_wasm(self : Program, buffer : Buffer) -> Unit 19 编译指令 利⽤内建 Buffer 数据结构,⽐拼接字符串更⾼效 1. fn Instruction::to_wasm(self : Instruction, buffer : Buffer) -> Unit { 2. match self { 3. Add => buffer.write_string("i32 write_string("i32.add ") 4. Local_Get(val) => buffer.write_string("local.get $\(val) ") 5. _ => buffer.write_string("...") 6. } 7. } 20 Wasm的⼆进制格式 ⽂本格式 ⼆进制格式 i32.const 0x41 i32.add 0x6A local.get0 码力 | 31 页 | 594.38 KB | 1 年前3
Comprehensive Rust(简体中文) 202412• &str is a slice of UTF-8 encoded bytes, similar to &[u8]. • String is an owned, heap-allocated buffer of UTF-8 bytes. fn main() { let s1: &str = "World"; println!("s1: {s1}"); let mut s2: String = as_bytes()) } fn main() -> Result<()> { let mut buffer = Vec::new(); log(&mut buffer, "Hello")?; log(&mut buffer, "World")?; println!("Logged: {:?}", buffer); 92 Ok(()) } 17.6 Default 特征 Default 特征会为类型生成默认值。 into a buffer. fn draw_into(&self, buffer: &mut dyn std::fmt::Write); 149 /// Draw the widget on standard output. fn draw(&self) { let mut buffer = String::new(); self.draw_into(&mut buffer); println0 码力 | 359 页 | 1.33 MB | 11 月前3
Greenplum分布式事务和两阶段提交协议图片来源:Systems Performance: Enterprise and the Cloud,中译本《性能之巅》, 作者Brendan Gregg 11 缓冲区Buffer Pool page … Buffer Pool Manager (Main Memory) Access Methods and other components dirty bit reference count 事务提交时,所修改的页面不需要强制刷回到持久存储中 ■ Steal / No-Steal Steal: 允许Buffer Pool里未提交事务所修改的脏页刷回到持久存储 No-steal: 不允许Buffer Pool里未提交事务所修改的脏页刷到持久存储中 缓冲区管理策略Buffer Management Policy 13 ■ Force策略的问题 对持久存储器进行频繁的随机写操作,性能下降。 No-Force / Steal 有更好的性能,但是怎么保证事务的原子性和持久 性? ❏ No-Force: 事务提交,所修改的数据页没有刷回至持久存储,如果发生断电 或者系统崩溃。 ❏ Steal: Buffer Pool中未提交的事务所修改的脏页刷回到持久存储,如果发生 断电或者系统崩溃。 缓冲区管理策略 14 ■ No-Force → Redo Log 事务提交时,数据页不需要刷回持久存储,为了保证持久性,先把Redo0 码力 | 42 页 | 2.12 MB | 1 年前3
httpd 2.4.23 中文文档Allows the addition of customizable debug logging at different phases of the request processing. mod_buffer Provides for buffering the input and output filter stacks mod_data Convert response body into the previous implementation of the mod_ssl session cache. Providers using a shared-memory cyclic buffer, disk-based dbm files, and a memcache distributed cache are currently supported. Cache Status Hook Directives mod_filter mod_deflate mod_ext_filter mod_include mod_charset_lite mod_reflector mod_buffer mod_data mod_ratelimit mod_reqtimeout mod_request mod_sed mod_substitute mod_xml2enc mod_proxy_html0 码力 | 2559 页 | 2.11 MB | 1 年前3
httpd 2.4.25 中文文档Allows the addition of customizable debug logging at different phases of the request processing. mod_buffer Provides for buffering the input and output filter stacks mod_data Convert response body into the previous implementation of the mod_ssl session cache. Providers using a shared-memory cyclic buffer, disk-based dbm files, and a memcache distributed cache are currently supported. Cache Status Hook Directives mod_filter mod_deflate mod_ext_filter mod_include mod_charset_lite mod_reflector mod_buffer mod_data mod_ratelimit mod_reqtimeout mod_request mod_sed mod_substitute mod_xml2enc mod_proxy_html0 码力 | 2573 页 | 2.12 MB | 1 年前3
httpd 2.4.20 中文文档Allows the addition of customizable debug logging at different phases of the request processing. mod_buffer Provides for buffering the input and output filter stacks mod_data Convert response body into the previous implementation of the mod_ssl session cache. Providers using a shared-memory cyclic buffer, disk-based dbm files, and a memcache distributed cache are currently supported. Cache Status Hook Directives mod_filter mod_deflate mod_ext_filter mod_include mod_charset_lite mod_reflector mod_buffer mod_data mod_ratelimit mod_reqtimeout mod_request mod_sed mod_substitute mod_xml2enc mod_proxy_html0 码力 | 2533 页 | 2.09 MB | 1 年前3
共 335 条
- 1
- 2
- 3
- 4
- 5
- 6
- 34













