class Ruby::SerialString

Attributes

read_index[R]
str[R]

Public Class Methods

new(_value = "") click to toggle source
# File lib/ruby/proto.rb, line 134
def initialize(_value = "")
  resetString(_value)
end

Public Instance Methods

resetString(_value = "") click to toggle source
# File lib/ruby/proto.rb, line 138
def resetString(_value = "")
  @str = ""
  @str.encode!("binary")
  _value = _value || ""
  @str <<_value
  @read_index = 0
end

Private Instance Methods

readDataImp(_length) click to toggle source
# File lib/ruby/proto.rb, line 151
def readDataImp(_length)
  str = @str.slice(@read_index, _length)
  return str if str.nil? || str.empty?
  _length = str.length
  @read_index += _length
  str
end
writeDataImp(_str) click to toggle source
# File lib/ruby/proto.rb, line 147
def writeDataImp(_str)
  @str << _str
end