how to convert an inputstream into a string in java

http‮w//:s‬ww.lautturi.com
how to convert an inputstream into a string in java
/**
 * @author lautturi.com
 * Java example:inputstream to string in java
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in).useDelimiter("\\n");
		String result = s.hasNext() ? s.next() : "";
		System.out.println(result);
	}
}

output:

123 455[enter]
123 455
Created Time:2017-09-17 13:10:08  Author:lautturi