44件ヒット
[1-44件を表示]
(0.091秒)
検索結果
先頭4件
-
ARGF
. class # getbyte -> Integer | nil (18357.0) -
self から 1 バイト(0..255)を読み込み整数として返します。 既に EOF に達していれば nil を返します。
...cho "bar" > file2
$ ruby argf.rb file1 file2
ARGF.getbyte # => 102
ARGF.getbyte # => 111
ARGF.getbyte # => 111
ARGF.getbyte # => 10
ARGF.getbyte # => 98
ARGF.getbyte # => 97
ARGF.getbyte # => 114
ARGF.getbyte # => 10
ARGF.getbyte # => nil
@see ARGF.class#getc, ARGF.class#gets... -
String
# getbyte(index) -> Integer | nil (18327.0) -
index バイト目のバイトを整数で返します。
...定した場合は nil を返します。
@param index バイトを取り出す位置
//emlist[例][ruby]{
s = "tester"
s.bytes # => [116, 101, 115, 116, 101, 114]
s.getbyte(0) # => 116
s.getbyte(1) # => 101
s.getbyte(-1) # => 114
s.getbyte(6) # => nil
//}... -
StringIO
# getbyte -> Integer | nil (18321.0) -
自身から 1 文字読み込んで、その文字に対応する Fixnum を返します。 文字列の終端に到達した時には nil を返します。
...字列の終端に到達した時には nil を返します。
@raise IOError 自身が読み取り不可なら発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("ho")
a.getbyte #=> 104
a.getbyte #=> 111
a.getbyte #=> nil
//}... -
IO
# getbyte -> Integer | nil (18315.0) -
IO から1バイトを読み込み整数として返します。 既に EOF に達していれば nil を返します。
...IO から1バイトを読み込み整数として返します。
既に EOF に達していれば nil を返します。
f = File.new("testfile")
f.getbyte #=> 84
f.getbyte #=> 104...