Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- readStream(in)
- URL url = new URL("http://www.android.com/");
- HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
- try
- {
- InputStream in = new BufferedInputStream(urlConnection.getInputStream());
- readStream(in); <-----NO SUCH METHOD
- }
- finally
- {
- urlConnection.disconnect();
- }
- InputStream in = address.openStream();
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
- StringBuilder result = new StringBuilder();
- String line;
- while((line = reader.readLine()) != null) {
- result.append(line);
- }
- System.out.println(result.toString());
- import org.springframework.util.FileCopyUtils;
- InputStream is = connection.getInputStream();
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- FileCopyUtils.copy(is, bos);
- String data = new String(bos.toByteArray());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement