code: public LangProfile read(InputStream inputStream) throws IOException {
  		StringBuilder buffer = new StringBuilder();
          try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("utf-8")))) {
              String line;
              while((line = reader.readLine()) != null) {
                  if (buffer.length() > 0) {
                      buffer.append(' ');
                  }
                  buffer.append(line);
              }
          }
  
  		String storedProfile = buffer.toString();
  		LangProfile langProfile = new LangProfile();
  
  		Matcher m = FREQ_PATTERN.matcher(storedProfile);
  		if (m.find()) {
  			String[] entries = m.group(1).split(",");
  			for (String entry : entries) {
  				String[] keyValue = entry.split(":");
  				String label = keyValue[0].trim().replace("\"", "");
  				langProfile.getFreq().put(label, Integer.valueOf(keyValue[1]));
  			}
  		}
  
  		m = N_WORDS_PATTERN.matcher(storedProfile);
  		if (m.find()) {
  			String[] nWords = m.group(1).split(",");
  			langProfile.setNWords(new int[nWords.length]);
  			for (int i = 0; i < nWords.length; i++) {
  				langProfile.getNWords()[i] = Integer.parseInt(nWords[i]);
  			}
  		}
  		
  		m = NAME_PATTERN.matcher(storedProfile);
  		if (m.find()) {
  			langProfile.setName(m.group(1));
  		}
  
  		return langProfile;
  	}
docs: Reads a {@link LangProfile} from an InputStream in UTF-8.