class Haxe::Io::Bytes

Attributes

b[RW]

protected - in ruby this doesn't play well with static/inline methods

length[RW]

Public Class Methods

new(length,b) click to toggle source
# File lib/lib/haxe/io/bytes.rb, line 8
def initialize(length,b)
  @length = length
  @b = b
end
of_string(s) click to toggle source
# File lib/lib/haxe/io/bytes.rb, line 26
def Bytes.of_string(s)
  ::Haxe::Io::Bytes.new(s.bytesize,s)
end

Public Instance Methods

get_string(pos,len) click to toggle source
# File lib/lib/haxe/io/bytes.rb, line 21
def get_string(pos,len)
  raise hx_raise(::Haxe::Io::Error.outside_bounds) if pos < 0 || len < 0 || pos + len > @length
  @b.byteslice(pos,len)
end