lib/bindata/io.rb in bindata-2.4.5 vs lib/bindata/io.rb in bindata-2.4.6

- old
+ new

@@ -211,10 +211,12 @@ end end # Creates a StringIO around +str+. def self.create_string_io(str = "") - StringIO.new(str.dup.force_encoding(Encoding::BINARY)) + s = StringIO.new(str.dup.force_encoding(Encoding::BINARY)) + s.binmode + s end # Create a new IO Read wrapper around +io+. +io+ must provide #read, # #pos if reading the current stream position and #seek if setting the # current stream position. If +io+ is a string it will be automatically