# File lib/bson/bson_ruby.rb, line 374
    def deserialize_code_w_scope_data(buf)
      buf.get_int
      len = buf.get_int
      code = buf.get(len)[0..-2]
      if code.respond_to? "pack"
        code = code.pack("C*")
      end

      scope_size = buf.get_int
      buf.position -= 4
      scope = @encoder.new.deserialize(buf.get(scope_size))

      Code.new(encoded_str(code), scope)
    end