I have one binary file and I want to read this file like first four bytes then next 5 bytes then next 3 bytes till file ends.
I am able to read file using each_byte but I want to categorize all these bytes in groups in sequence they are stored in file.
I am able to read this using following lines but dont know how to read in fixed sized blocks with continutation.
File.open('myfile','rb') do |file|
file.each_byte {|ch| print "#{ch.chr}:#{ch}\t"}
end