U:RDoc::AnyMethod[iI" read:ETI" IO::read;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"JOpens the file, optionally seeks to the given +offset+, then returns ;TI"M+length+ bytes (defaulting to the rest of the file). read ;TI"1ensures the file is closed before returning.;To:RDoc::Markup::BlankLineo; ; [I"PIf +name+ starts with a pipe character ("|"), a subprocess is ;TI"Hcreated in the same way as Kernel#open, and its output is returned.;T@S:RDoc::Markup::Heading: leveli: textI" Options;T@o; ; [I"1The options hash accepts the following keys:;T@o:RDoc::Markup::List: @type: NOTE: @items[o:RDoc::Markup::ListItem: @label[I":encoding;T; [ o; ; [I"string or encoding;T@o; ; [I"MSpecifies the encoding of the read string. +:encoding+ will be ignored ;TI"Lif +length+ is specified. See Encoding.aliases for possible encodings.;T@o;;[I" :mode;T; [ o; ; [I" string;T@o; ; [I"CSpecifies the mode argument for open(). It must start ;TI"4with an "r", otherwise it will cause an error. ;TI"/See IO.new for the list of possible modes.;T@o;;[I":open_args;T; [ o; ; [I" array;T@o; ; [I"KSpecifies arguments for open() as an array. This key can not be used ;TI"7in combination with either +:encoding+ or +:mode+.;T@o; ; [I"Examples:;T@o:RDoc::Markup::Verbatim; [ I"sIO.read("testfile") #=> "This is line one\nThis is line two\nThis is line three\nAnd so on...\n" ;TI"BIO.read("testfile", 20) #=> "This is line one\nThi" ;TI"BIO.read("testfile", 20, 10) #=> "ne one\nThis is line " ;TI"@IO.read("binfile", mode: "rb") #=> "\xF7\x00\x00\x0E\x12";T: @format0: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"=IO.read(name, [length [, offset]] [, opt] ) -> string ;T0[I"-(p1, p2 = v2, p3 = v3, p4 = v4, p5 = {});T@GFI"IO;TcRDoc::NormalClass00