I have a an InputStream as a parameter, which works just fine when I read it for the first time, however, reading the same InputStream doesn't work. I just can't get mark()
and reset()
to work. Anyone know how to reset this? I'm reading a .txt file. The file contains spawn values for enemy objects that don't reappear, since the inputstream mark(?) is at the end, I guess?
readTxt(InputStream resource){
//resource is a .txt as ResourceStream
arrayList = new BufferedReader(new InputStreamReader(resource,
StandardCharsets.UTF_8)).lines().collect(Collectors.toList());