each_byte is always associated with a block. : each byte « File Directory « Ruby






each_byte is always associated with a block.



file5 = File.new("C:\\Ruby\\Sample")
file5.each_byte{|ch| putc ch}

 

Related examples in the same category

1.read an I/O stream byte by byte with each_byte:
2.Count bytes