From: matz@... (Yukihiro Matsumoto) Date: 2000-12-12T14:37:30+09:00 Subject: [ruby-talk:7067] Re: Reading lots of binary data into arrays Hi, In message "[ruby-talk:7049] Reading lots of binary data into arrays" on 00/12/12, Dwight Tuinstra writes: |1) Are there packages/extensions/modules available | for reading large amounts of binary data into arrays | of structures? I know that binary data can be read | a "char" at a time, but this is likely to be too | slow. Read fixed sized string using IO#read then unpack it into integers using String#unpack. For example: input = open(path_to_file, "r") ary = [] size_of_an_entry = (32*3+2*16)/8 while str = input.read(size_of_an_entry) ary.push(str.unpack("NNNnn")) # assuming network byte order end |2) What is the best library to use to get fastest | performance in displaying a large array of data? | (Each element of the array is displayed as a small | bar of different size and color). I recall reading | somewhere that gtk was faster than Tk. Is this true? Ruby/Gtk is often faster than Ruby/Tk since it does not work via Tcl. matz.