Here you can find the source of loadStringUTF8(InputStream in)
public static StringBuffer loadStringUTF8(InputStream in) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; import java.nio.charset.StandardCharsets; public class Main { public static StringBuffer loadStringUTF8(InputStream in) throws IOException { return loadString(new InputStreamReader(in, StandardCharsets.UTF_8)); }/*from w ww .ja v a2 s . co m*/ public static StringBuffer loadString(Reader reader) throws IOException { try (BufferedReader bis = new BufferedReader(reader)) { StringBuffer sb = new StringBuffer(); for (;;) { int c = bis.read(); if (c < 0) { break; } sb.append((char) c); } return sb; } } }