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
io_buffer.c
View on GitHub ↗
static VALUE
io_buffer_s_new(int argc, VALUE *argv, VALUE klass)
{
if (klass == rb_cIOBuffer) klass = rb_cIOBufferStorage;
return rb_class_new_instance_kw(argc, argv, klass, RB_PASS_CALLED_KEYWORDS);
}
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.