Skip to content

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

instance method

IO::Buffer#external?

external? → true or false

The buffer is external if it references the memory which is not allocated or mapped by the buffer itself.

A buffer created using ::for has an external reference to the string’s memory.

External buffer can’t be resized.

See also #empty? #free #each_byte #get_string also in 4.0 · 3.4 · 3.2 · 3.1