ResponseRange.parse constructor

ResponseRange.parse(
  1. String? raw
)

Implementation

ResponseRange.parse(String? raw) {
  if (raw == null) {
    return;
  }
  RegExpMatch? matcher = RegExp('bytes *(\\d+)-(\\d+)/(\\d+|\\*)').firstMatch(raw);
  if (matcher != null) {
    specified = true;
    begin = int.parse(matcher.group(1)!);
    end = int.parse(matcher.group(2)!);
    if (matcher.group(3) != '*') {
      size = int.parse(matcher.group(3)!);
    }
  }
}