src/main/java/de/blau/android/LicenseViewer.java
/**
     * Load a text file in to a StringBuilder
     * 
     * @param filename the name of the file
     * @param builder the StringBuilder
     */
Load a text file in to a StringBuilder

@param filename the name of the file
@param builder the StringBuilder
Load a text file in to a StringBuilder @param filename the name of the file @param builder the StringBuilder
private void load(@NonNull String filename, @NonNull StringBuilder builder) {
        builder.append("== " + filename + " ==\n");
        try (InputStreamReader reader = new InputStreamReader(getAssets().open(filename), OsmXml.UTF_8)) {
            int read = 0;
            do {
                char[] buf = new char[4096];
                read = reader.read(buf);
                if (read > 0) {
                    builder.append(buf, 0, read);
                }
            } while (read > 0);
        } catch (Exception e) {
            builder.append("Error while loading file: " + e.getMessage());
        }
        builder.append("\n\n\n\n");
    }
private void load ( @ NonNull String filename , @ NonNull StringBuilder builder ) { builder . append ( "== " + filename + " ==\n" ) ; try ( InputStreamReader reader = new InputStreamReader ( getAssets ( ) . open ( filename ) , OsmXml . UTF_8 ) ) { int read = 0 ; do { char [ ] buf = new char [ 4096 ] ; read = reader . read ( buf ) ; if ( read > 0 ) { builder . append ( buf , 0 , read ) ; } } while ( read > 0 ) ; } catch ( Exception e ) { builder . append ( "Error while loading file: " + e . getMessage ( ) ) ; } builder . append ( "\n\n\n\n" ) ; }
Load a text file in to a StringBuilder
Load a text file in to a StringBuilder