java.io.IOException

Stream closed

Samebug tips1

When you iterate over the lines of a scala.io.Source with source.getLines, make sure you do not close the source until you processed the iterator.


rprp

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web288

  • via Unknown by 807595,
  • via Unknown by 807594,
  • via Unknown by 807594,
  • Stack trace

    • java.io.IOException: Stream closed at java.io.BufferedInputStream.ensureOpen(BufferedInputStream.java:120) at java.io.BufferedInputStream.read(BufferedInputStream.java:270) at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:406) at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:446) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:180) at java.io.InputStreamReader.read(InputStreamReader.java:167) at java.io.BufferedReader.fill(BufferedReader.java:136) at java.io.BufferedReader.readLine(BufferedReader.java:299) at java.io.BufferedReader.readLine(BufferedReader.java:362) at MorseCode.main(MorseCode.java:85)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    zbalintzbalint
    Once,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    16 more bugmates