Skip to content

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

instance method

IO::Buffer#empty?

external? → true or false
If the buffer is _external_, meaning it references from 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 #copy #external? #clear #free also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2