D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
IO
/
Buffer
/
Filename :
new-c.ri
back
Copy
U:RDoc::AnyMethod[iI"new:ETI"IO::Buffer::new;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I":Create a new zero-filled IO::Buffer of +size+ bytes. ;TI"IBy default, the buffer will be _internal_: directly allocated chunk ;TI"Iof the memory. But if the requested +size+ is more than OS-specific ;TI"DIO::Buffer::PAGE_SIZE, the buffer would be allocated using the ;TI"Hvirtual memory mechanism (anonymous +mmap+ on Unix, +VirtualAlloc+ ;TI"Kon Windows). The behavior can be forced by passing IO::Buffer::MAPPED ;TI"as a second parameter.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I" buffer = IO::Buffer.new(4) ;TI" # => ;TI"3# #<IO::Buffer 0x000055b34497ea10+4 INTERNAL> ;TI"H# 0x00000000 00 00 00 00 .... ;TI" ;TI")buffer.get_string(0, 1) # => "\x00" ;TI" ;TI"buffer.set_string("test") ;TI"buffer ;TI" # => ;TI"3# #<IO::Buffer 0x000055b34497ea10+4 INTERNAL> ;TI"G# 0x00000000 74 65 73 74 test;T:@format0: @fileI"io_buffer.c;T:0@omit_headings_from_table_of_contents_below0I"EIO::Buffer.new([size = DEFAULT_SIZE, [flags = 0]]) -> io_buffer ;T0[ I"(*args);T@#FI"Buffer;TcRDoc::NormalClass00