我想询问有关Java的问题。我已经使用Java中的URLConnection来检索DataInputStream,并且我想将DataInputStream转换为Java中的String变量。我该怎么做?有人可以帮我吗?谢谢。
以下是我的代码:
URL data = new URL("http://google.com");
URLConnection dataConnection = data.openConnection();
DataInputStream dis = new DataInputStream(dataConnection.getInputStream());
String data_string;
// convent the DataInputStream to the String