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

parent 167e0b3f
...@@ -77,7 +77,7 @@ Add the line below to your build configuration. ...@@ -77,7 +77,7 @@ Add the line below to your build configuration.
| IO#puts | o | | | IO#puts | o | |
| IO#read | o | | | IO#read | o | |
| IO#read_nonblock | | | | IO#read_nonblock | | |
| IO#readbyte | | | | IO#readbyte | o | |
| IO#readchar | o | | | IO#readchar | o | |
| IO#readline | o | | | IO#readline | o | |
| IO#readlines | o | | | IO#readlines | o | |
......
...@@ -299,6 +299,11 @@ class IO ...@@ -299,6 +299,11 @@ class IO
end end
end end
def readbyte
_read_buf
IO._bufread(@buf, 1).getbyte(0)
end
def getbyte def getbyte
ret = getc ret = getc
return ret.getbyte 0 if ret 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