public static String readStreamAsString(InputStream stream) throws IOException {
    """
	Reads whole content of input stream to String
	
	@param stream Opened stream
	@return Stream content
	@throws IOException Thrown if data couldn't be loaded
    """
        try (Scanner sc = new Scanner(stream, Charset.defaultCharset().name())) {
            sc.useDelimiter("\\A");
            return sc.next();
        }
    }
public static String readStreamAsString(InputStream stream) throws IOException {
        try (Scanner sc = new Scanner(stream, Charset.defaultCharset().name())) {
            sc.useDelimiter("\\A");
            return sc.next();
        }
    }
public static String readStreamAsString ( InputStream stream ) throws IOException { try ( Scanner sc = new Scanner ( stream , Charset . defaultCharset ( ) . name ( ) ) ) { sc . useDelimiter ( "\\A" ) ; return sc . next ( ) ; } }
Reads whole content of input stream to String

@param stream Opened stream
@return Stream content
@throws IOException Thrown if data couldn't be loaded
Reads whole content of input stream to String