Create a gist now

Instantly share code, notes, and snippets.

The secret to easily reading a URL
String locUrlString = "http://jsonplaceholder.typicode.com/albums";
Reader bufReader = new BufferedReader(
new InputStreamReader(new URL(locUrlString).openStream()));
StringBuilder myStrBuilder = new StringBuilder();
while((builderLine = ((BufferedReader)bufReader).readLine()) != null) {
myStrBuilder.append(builderLine);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment