Skip to content

Instantly share code, notes, and snippets.

@Raouf25
Last active April 10, 2020 16:55
Show Gist options
  • Save Raouf25/20b981f38a01cd0d76bfe4216684aba3 to your computer and use it in GitHub Desktop.
Save Raouf25/20b981f38a01cd0d76bfe4216684aba3 to your computer and use it in GitHub Desktop.
files.stream()
.parallel()
.map(file-> {
try {
return file.getInputStream();
} catch (IOException e) {
e.printStackTrace();
return null;
}
})
.forEach(inputStream -> carService.saveCars(inputStream));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment