code: private void getOffset(long time, boolean local, int NonExistingTimeOpt, int DuplicatedTimeOpt, int[] offsets) {
          complete();
          TimeZoneRule rule = null;
          if (historicTransitions == null) {
              rule = initialRule;
          } else {
              long tstart = getTransitionTime(historicTransitions.get(0),
                      local, NonExistingTimeOpt, DuplicatedTimeOpt);
              if (time < tstart) {
                  rule = initialRule;
              } else {
                  int idx = historicTransitions.size() - 1;
                  long tend = getTransitionTime(historicTransitions.get(idx),
                          local, NonExistingTimeOpt, DuplicatedTimeOpt);
                  if (time > tend) {
                      if (finalRules != null) {
                          rule = findRuleInFinal(time, local, NonExistingTimeOpt, DuplicatedTimeOpt);
                      }
                      if (rule == null) {
                          // no final rules or the given time is before the first transition
                          // specified by the final rules -> use the last rule
                          rule = (historicTransitions.get(idx)).getTo();
                      }
                  } else {
                      // Find a historical transition
                      while (idx >= 0) {
                          if (time >= getTransitionTime(historicTransitions.get(idx),
                                  local, NonExistingTimeOpt, DuplicatedTimeOpt)) {
                              break;
                          }
                          idx--;
                      }
                      rule = (historicTransitions.get(idx)).getTo();
                  }
              }
          }
          offsets[0] = rule.getRawOffset();
          offsets[1] = rule.getDSTSavings();
      }
docs: /*
  getOffset internal implementation