private void load(final InputStream istream, final Loader loader) {
        logger.debug("Loading the cache from input stream");
        String line;
        try (
            InputStreamReader isr =
                    new InputStreamReader(istream, Charset.forName("UTF-8"));
            BufferedReader br = new BufferedReader(isr);
        ) {
            while ((line = br.readLine()) != null) {
                final String[] splitLine = line.split("[|]", 4);
                if (splitLine.length >= 2 && !splitLine[1].isEmpty()) {
                    loader.load(splitLine[0], splitLine[1]);
                } else if (splitLine[0] != null && !splitLine[0].isEmpty()) {
                    loader.load(splitLine[0], splitLine[0]);
                }
            }
        } catch (IOException e) {
            logger.error("Problem reading places stream", e);
        }
    }
private void load ( final InputStream istream , final Loader loader ) { logger . debug ( "Loading the cache from input stream" ) ; String line ; try ( InputStreamReader isr = new InputStreamReader ( istream , Charset . forName ( "UTF-8" ) ) ; BufferedReader br = new BufferedReader ( isr ) ; ) { while ( ( line = br . readLine ( ) ) != null ) { final String [ ] splitLine = line . split ( "[|]" , 4 ) ; if ( splitLine . length >= 2 && ! splitLine [ 1 ] . isEmpty ( ) ) { loader . load ( splitLine [ 0 ] , splitLine [ 1 ] ) ; } else if ( splitLine [ 0 ] != null && ! splitLine [ 0 ] . isEmpty ( ) ) { loader . load ( splitLine [ 0 ] , splitLine [ 0 ] ) ; } } } catch ( IOException e ) { logger . error ( "Problem reading places stream" , e ) ; } }
Read places from an input stream. The format is | separated. It may
contain just a historical place name or both historical and modern
places names.

@param istream the input stream
@param loader what to do with each line