Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Read a text file as a Stream
- try (InputStream inputStream =
- Thread.currentThread().getContextClassLoader().getResourceAsStream(PUT_RECORD_STREAM_SOURCE)) {
- if (inputStream == null)
- {
- throw new FileNotFoundException("Could not find file " + PUT_RECORD_STREAM_SOURCE);
- }
- try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)))
- {
- String line = null;
- while ((line = reader.readLine()) != null)
- {
- String data = line + "\n";
- }
- }
Add Comment
Please, Sign In to add comment