class SFML::InputStream

Bridge between a Ruby IO-like object (anything with read(n), seek(pos), pos / tell, and size) and CSFML’s sfInputStream* parameter on *_createFromStream loader functions.

Typical use is indirect — pass a Ruby IO to the .from_stream factory on Font, Image, Texture, Shader, Music, or SoundBuffer:

File.open(“assets/hero.png”, “rb”) do |io| tex = SFML::Texture.from_stream(io) end

Direct use is for advanced cases (custom virtual filesystems, network streams, etc.). Subclass or build with .new(io):

wrapped = SFML::InputStream.new(my_random_access_io) font = SFML::Font.send(:_load_from_stream_handle, wrapped.struct)

The InputStream object must outlive the loader call — keep a reference until the CSFML factory returns. The wrapped IO is not closed automatically; close it yourself.