Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

IO::Buffer.size_of

size_of(buffer_type) → byte size
size_of(array of buffer_type) → byte size

Returns the size of the given buffer type(s) in bytes.

Example
IO::Buffer.size_of(:u32) # => 4
IO::Buffer.size_of([:u32, :u32]) # => 8
See also .new .string .map #& also in 4.1 · 4.0 · 3.4 · 3.2