mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
io.rb: add IO#readbyte; ref #5389
This commit is contained in:
@@ -77,7 +77,7 @@ Add the line below to your build configuration.
|
||||
| IO#puts | o | |
|
||||
| IO#read | o | |
|
||||
| IO#read_nonblock | | |
|
||||
| IO#readbyte | | |
|
||||
| IO#readbyte | o | |
|
||||
| IO#readchar | o | |
|
||||
| IO#readline | o | |
|
||||
| IO#readlines | o | |
|
||||
|
||||
@@ -299,6 +299,11 @@ class IO
|
||||
end
|
||||
end
|
||||
|
||||
def readbyte
|
||||
_read_buf
|
||||
IO._bufread(@buf, 1).getbyte(0)
|
||||
end
|
||||
|
||||
def getbyte
|
||||
ret = getc
|
||||
return ret.getbyte 0 if ret
|
||||
|
||||
Reference in New Issue
Block a user