D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
IO
/
Buffer
/
Filename :
pread-i.ri
back
Copy
U:RDoc::AnyMethod[iI" pread:ETI"IO::Buffer#pread;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"QRead at least +length+ bytes from the +io+ starting at the specified +from+ ;TI"Iposition, into the buffer starting at +offset+. If an error occurs, ;TI"return <tt>-errno</tt>.;To:RDoc::Markup::BlankLine o; ; [I"NIf +length+ is not given or +nil+, it defaults to the size of the buffer ;TI".minus the offset, i.e. the entire buffer.;T@o; ; [I"JIf +length+ is zero, exactly one <tt>pread</tt> operation will occur.;T@o; ; [I"NIf +offset+ is not given, it defaults to zero, i.e. the beginning of the ;TI"buffer.;T@o:RDoc::Markup::Verbatim; [I"(IO::Buffer.for('test') do |buffer| ;TI" p buffer ;TI" # => ;TI"1 # <IO::Buffer 0x00007fca40087c38+4 SLICE> ;TI". # 0x00000000 74 65 73 74 test ;TI" ;TI"5 # take 2 bytes from the beginning of urandom, ;TI"5 # put them in buffer starting from position 2 ;TI"> buffer.pread(File.open('/dev/urandom', 'rb'), 0, 2, 2) ;TI" p buffer ;TI" # => ;TI": # <IO::Buffer 0x00007f3bc65f2a58+4 EXTERNAL SLICE> ;TI". # 0x00000000 05 35 73 74 te.5 ;TI"end;T:@format0: @fileI"io_buffer.c;T:0@omit_headings_from_table_of_contents_below0I"Bpread(io, from, [length, [offset]]) -> read length or -errno ;T0[ I"(*args);T@,FI"Buffer;TcRDoc::NormalClass00