Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

IO::Buffer.size_of

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

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

Example:

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