io.rb: add `IO#readbyte`; ref #5389

parent 167e0b3f
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment