Skip to content

Instantly share code, notes, and snippets.

@MarounMaroun
Last active July 13, 2016 16:05
Show Gist options
  • Select an option

  • Save MarounMaroun/4e6a0f5aef12458af06214667d001107 to your computer and use it in GitHub Desktop.

Select an option

Save MarounMaroun/4e6a0f5aef12458af06214667d001107 to your computer and use it in GitHub Desktop.
private static List<String> getData(InputStream input) {
List<String> result = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(input));
while (true) {
String line = null;
try {
line = reader.readLine();
} catch (IOException exception) { }
if (line == null) break;
result.add(line);
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment