112件ヒット
[1-100件を表示]
(0.079秒)
別のキーワード
クラス
-
Net
:: POP3 (12) -
OpenSSL
:: BN (12) - StringIO (28)
- StringScanner (24)
モジュール
-
Net
:: HTTPHeader (36)
キーワード
-
content
_ range (12) -
each
_ byte (14) -
num
_ bytes (12) - peek (12)
- peep (12)
- range (12)
-
range
_ length (12) -
set
_ debug _ output (12)
検索結果
先頭5件
-
StringIO
# bytes -> Enumerator (18109.0) -
自身から 1 バイトずつ読み込み、整数 ch に変換し、それを引数として与えられたブロックを実行します。
...変換し、それを引数として与えられたブロックを実行します。
@raise IOError 自身が読み取り不可なら発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.each_byte{|ch| p ch }
#=> 104
# 111
# 103
# 101
//}
@see IO#each_byte... -
StringIO
# bytes {|ch| . . . } -> self (18109.0) -
自身から 1 バイトずつ読み込み、整数 ch に変換し、それを引数として与えられたブロックを実行します。
...変換し、それを引数として与えられたブロックを実行します。
@raise IOError 自身が読み取り不可なら発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.each_byte{|ch| p ch }
#=> 104
# 111
# 103
# 101
//}
@see IO#each_byte... -
OpenSSL
:: BN # num _ bytes -> Integer (6138.0) -
自身を表現するのに使っているバイト数を返します。
...自身を表現するのに使っているバイト数を返します。
//emlist[][ruby]{
require 'openssl'
p 0.to_bn.num_bytes # => 0
p 255.to_bn.num_bytes # => 1
p 256.to_bn.num_bytes # => 2
p 0b111_11111.to_bn.num_bytes # => 1
p 0b1000_00000.to_bn.num_bytes # => 2
//}... -
StringIO
# each _ byte -> Enumerator (3009.0) -
自身から 1 バイトずつ読み込み、整数 ch に変換し、それを引数として与えられたブロックを実行します。
...変換し、それを引数として与えられたブロックを実行します。
@raise IOError 自身が読み取り不可なら発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.each_byte{|ch| p ch }
#=> 104
# 111
# 103
# 101
//}
@see IO#each_byte... -
StringIO
# each _ byte {|ch| . . . } -> self (3009.0) -
自身から 1 バイトずつ読み込み、整数 ch に変換し、それを引数として与えられたブロックを実行します。
...変換し、それを引数として与えられたブロックを実行します。
@raise IOError 自身が読み取り不可なら発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.each_byte{|ch| p ch }
#=> 104
# 111
# 103
# 101
//}
@see IO#each_byte... -
StringScanner
# peek(bytes) -> String (149.0) -
スキャンポインタから長さ bytes バイト分だけ文字列を返します。
...スキャンポインタから長さ bytes バイト分だけ文字列を返します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.peek(4) # => "test"
//}
また、このメソッドを実行してもスキャンポインタは移動しません。
StringScan......わりに StringScanner#peek を使ってください。
@param bytes 0 以上の整数を指定します。
ただし、スキャン対象の文字列の長さを超える分は無視されます。
bytes が 0 のとき、またはスキャンポインタが文字列の......末尾を
指しているときは空文字列 ("") を返します。
@raise ArgumentError bytes に負数を与えると発生します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
p s.peek(4) # => "test"
p s.peek(20) # => "test string"
p s.... -
StringScanner
# peep(bytes) -> String (149.0) -
スキャンポインタから長さ bytes バイト分だけ文字列を返します。
...スキャンポインタから長さ bytes バイト分だけ文字列を返します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.peek(4) # => "test"
//}
また、このメソッドを実行してもスキャンポインタは移動しません。
StringScan......わりに StringScanner#peek を使ってください。
@param bytes 0 以上の整数を指定します。
ただし、スキャン対象の文字列の長さを超える分は無視されます。
bytes が 0 のとき、またはスキャンポインタが文字列の......末尾を
指しているときは空文字列 ("") を返します。
@raise ArgumentError bytes に負数を与えると発生します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
p s.peek(4) # => "test"
p s.peek(20) # => "test string"
p s.... -
Net
:: HTTPHeader # range -> Range|nil (19.0) -
Range: ヘッダの示す範囲を Range オブジェクトで返します。
...。
//emlist[例 正常な値][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['range'] = "bytes=1-5"
req.range # => [1..5]
//}
//emlist[例 Net::HTTPHeaderSyntaxError][ruby]{
require 'net/http'
uri = URI.parse('http://... -
Net
:: HTTPHeader # content _ range -> Range|nil (13.0) -
Content-Range: ヘッダフィールドの値を Range で返します。 Range の表わす長さは Net::HTTPHeader#range_length で得られます。
...ていない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_range # => nil
req['Content-Range'] = "bytes 0-499/1234"
req.content_range # => 0..499
//}... -
Net
:: HTTPHeader # range _ length -> Integer|nil (13.0) -
Content-Range: ヘッダフィールドの表している長さを整数で返します。
...発生します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req['Content-Range'] = "bytes 1-500/1000"
req.range_length # => 500
//}...