Skip to content

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

instance method

IO#getbyte

ios.getbyte → integer or nil

Gets the next 8-bit byte (0..255) from ios. Returns nil if called at end of file.

Example
f = File.new("testfile")
f.getbyte   #=> 84
f.getbyte   #=> 104
See also #fsync #getc #flush #getch also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1