private static ZoneId ofWithPrefix(String zoneId,int prefixLength,boolean checkAvailable){
  String prefix=zoneId.substring(0,prefixLength);
  if (zoneId.length() == prefixLength) {
    return ofOffset(prefix,ZoneOffset.UTC);
  }
  if (zoneId.charAt(prefixLength) != '+' && zoneId.charAt(prefixLength) != '-') {
    return ZoneRegion.ofId(zoneId,checkAvailable);
  }
  try {
    ZoneOffset offset=ZoneOffset.of(zoneId.substring(prefixLength));
    if (offset == ZoneOffset.UTC) {
      return ofOffset(prefix,offset);
    }
    return ofOffset(prefix,offset);
  }
 catch (  DateTimeException ex) {
    throw new DateTimeException("Invalid ID for offset-based ZoneId: " + zoneId,ex);
  }
}

private static ZoneId ofWithPrefix ( String zoneId , int prefixLength , boolean checkAvailable ) { String prefix = zoneId . substring ( 0 , prefixLength ) ; if ( zoneId . length ( ) == prefixLength ) { return ofOffset ( prefix , ZoneOffset . UTC ) ; } if ( zoneId . charAt ( prefixLength ) != '+' && zoneId . charAt ( prefixLength ) != '-' ) { return ZoneRegion . ofId ( zoneId , checkAvailable ) ; } try { ZoneOffset offset = ZoneOffset . of ( zoneId . substring ( prefixLength ) ) ; if ( offset == ZoneOffset . UTC ) { return ofOffset ( prefix , offset ) ; } return ofOffset ( prefix , offset ) ; } catch ( DateTimeException ex ) { throw new DateTimeException ( "Invalid ID for offset-based ZoneId: " + zoneId , ex ) ; } }
parse once a prefix is established .
