るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.041秒)

別のキーワード

  1. stringio read
  2. _builtin read
  3. io read
  4. csv read
  5. pathname read

クラス

検索結果

IO#readbyte -> Integer (27227.0)

IO から1バイトを読み込み整数として返します。 既に EOF に達していれば EOFError が発生します。

...EOF に達している場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "123")
File.open("testfile") do |f|
begin
f.readbyte # => 49
f.readbyte # => 50
f.readbyte # => 51
f.readbyte # => 例外発生
rescue => e
e.class # => EOFError
end
end
//}...