getbyte

ARGF.getbyte â Fixnum or nil
Instance Public methods

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

For example:

1
2
3
4
5
6
7
8
$ echo "foo" > file
$ ruby argf.rb file
 
ARGF.getbyte #=> 102
ARGF.getbyte #=> 111
ARGF.getbyte #=> 111
ARGF.getbyte #=> 10
ARGF.getbyte #=> nil
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.