diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-04-10 19:04:58 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-04-10 19:08:15 +0900 |
| commit | 8fa1ff9a03e1331a12408cece0f07f367be9ae1b (patch) | |
| tree | f341e046a3c6ad090e50390e3de0a37aabd90ee7 /mrbgems/mruby-io/mrblib | |
| parent | 167e0b3f4f12133e035d5771070628637398c149 (diff) | |
| download | mruby-8fa1ff9a03e1331a12408cece0f07f367be9ae1b.tar.gz mruby-8fa1ff9a03e1331a12408cece0f07f367be9ae1b.zip | |
io.rb: add `IO#readbyte`; ref #5389
Diffstat (limited to 'mrbgems/mruby-io/mrblib')
| -rw-r--r-- | mrbgems/mruby-io/mrblib/io.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mrbgems/mruby-io/mrblib/io.rb b/mrbgems/mruby-io/mrblib/io.rb index 6519df9de..8d00c316d 100644 --- a/mrbgems/mruby-io/mrblib/io.rb +++ b/mrbgems/mruby-io/mrblib/io.rb @@ -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 |
