module HTTP2Next::StringExtensions

Public Instance Methods

read(n) click to toggle source
# File lib/http/2/next/extensions.rb, line 16
def read(n)
  return "".b if n == 0

  chunk = byteslice(0..n - 1)
  remaining = byteslice(n..-1)
  remaining ? replace(remaining) : clear
  chunk
end
read_uint32() click to toggle source
# File lib/http/2/next/extensions.rb, line 25
def read_uint32
  read(4).unpack1("N")
end
shift_byte() click to toggle source
# File lib/http/2/next/extensions.rb, line 29
def shift_byte
  read(1).ord
end
unpack1(format) click to toggle source
# File lib/http/2/next/extensions.rb, line 34
def unpack1(format)
  unpack(format).first
end