Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

IO::Buffer.new

(?::Integer size, ?::Integer flags) -> ::IO::Buffer
IO::Buffer.new([size, [flags]]) → storage

Creates an IO::Buffer::Storage with the given size and flags. Buffer is the common byte-view interface; this factory creates one storage-bearing object, not a separate view and allocation. See IO::Buffer::Storage.new.

See also .map .size_of .for .string also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1