--- riff-0.3.1/lib/riff/reader.rb.orig	2009-07-01 01:14:42.000000000 -0400
+++ riff-0.3.1/lib/riff/reader.rb	2009-07-01 01:34:12.000000000 -0400
@@ -137,6 +137,9 @@
       # the offset of this chunk from the start of its file
       attr_reader :offset
     
+      # ruby 1.9 compatibility
+      GETBYTE = STDIN.respond_to?(:getbyte) ? :getbyte : :getc
+  
       
       def self.read_chunk(fp) #:nodoc:
         code = fp.read(4)  
@@ -163,7 +166,7 @@
       # Yields each byte of the data chunk.
       def each_byte
         while @file.pos < @offset + 8 + @length
-          yield @file.getc  
+          yield @file.send(GETBYTE)
         end
       end
   
@@ -172,7 +175,7 @@
       def Chunk.read_bytes_to_int(file,bytes) # :nodoc:
     
         ary = [ ]
-        bytes.times { ary << file.getc }
+        bytes.times { ary << file.send(GETBYTE) }
     
         result = 0
         ary.each_with_index do |n, i|
