private static CharSequence convertReverseDNSIPv4 ( String str , int suffixStartIndex ) throws AddressStringException { StringBuilder builder = new StringBuilder ( suffixStartIndex ) ; int segCount = 0 ; int j = suffixStartIndex ; for ( int i = suffixStartIndex - 1 ; i > 0 ; i -- ) { char c1 = str . charAt ( i ) ; if ( c1 == IPv4Address . SEGMENT_SEPARATOR ) { if ( j - i <= 1 ) { throw new AddressStringException ( str , i ) ; } for ( int k = i + 1 ; k < j ; k ++ ) { builder . append ( str . charAt ( k ) ) ; } builder . append ( c1 ) ; j = i ; segCount ++ ; } } for ( int k = 0 ; k < j ; k ++ ) { builder . append ( str . charAt ( k ) ) ; } if ( segCount + 1 != IPv4Address . SEGMENT_COUNT ) { throw new AddressStringException ( str , 0 ) ; } return builder ; }
123 . 2 . 3 . 4 is 4 . 3 . 2 . 123 . in - addr . arpa .