Can you say anything about what API is expected on the "io" object? Or how would we figure this out? I'm getting stymied by my difficulty reading C.
In some experimentation, it _seems_ like perhaps all Nokogiri::XML::Reader expects from it's `io` argument is a `read(num_bytes)` method. Does this seem plausible? Would there be a way to confirm it? Could it be documented as API?
Experimentation also reveals that, while Nokogiri::XML::Reader can tolerate it when `read(some_num_bytes)` returns less bytes than the argument (I think this is not unusual in ruby IO-like object's #read?), it can _not_ tolerate if the call returns 0 bytes (the empty string). I found this out when trying to use it with http.rb (wrapped in a little shim to make http.rb's #readpartial method the #read method that Nokogiri::XML::Reader seems to want), discovered that it sometimes returns 0 bytes (which may or may not be a bug), and that this caused Nokogiri::XML::Reader to raise.
Whatever open-uri returns may or may not work (without weird edge-case bugs waiting?) with Nokogiri::XML::Reader. But I don't particularly want to use open-uri, I don't find it to be sufficiently flexible a library.
What I really want to know is what API nokogiri expects on it's `io` objects, so I can figure out the best way for my needs/context to provide an `io` object with the expected API. Any thoughts?