pradeepsjsu / beanio

Automatically exported from code.google.com/p/beanio
Apache License 2.0
0 stars 0 forks source link

Possible IOException when reading a malformed CSV record from the last "line" in a stream #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
See stack trace.

java.lang.IllegalStateException: Stream already closed
    at org.jvnet.mimepull.DataHead$ReadMultiStream.fetch(DataHead.java:237)
    at org.jvnet.mimepull.DataHead$ReadMultiStream.read(DataHead.java:212)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
    at sun.nio.cs.StreamDecoder.read0(StreamDecoder.java:107)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:93)
    at java.io.InputStreamReader.read(InputStreamReader.java:151)
    at org.beanio.stream.csv.CsvReader.read(CsvReader.java:185)
    at org.beanio.stream.csv.CsvReader.read(CsvReader.java:48)
    at org.beanio.internal.parser.UnmarshallingContext.nextRecord(UnmarshallingContext.java:409)
    at org.beanio.internal.parser.BeanReaderImpl.nextRecord(BeanReaderImpl.java:130)
    at org.beanio.internal.parser.BeanReaderImpl.internalRead(BeanReaderImpl.java:93)
    at org.beanio.internal.parser.BeanReaderImpl.read(BeanReaderImpl.java:64)

Original issue reported on code.google.com by kevin.s...@gmail.com on 14 Feb 2013 at 8:17

GoogleCodeExporter commented 9 years ago
If a malformed record is read from the last line in a file, the client is not 
aware that EOF has been reached and may call beanReader.read() again which can 
cause the IOException.  This defect applies to delimited in fixed length 
records as well (if line continuation is allowed).

Original comment by kevin.s...@gmail.com on 15 Feb 2013 at 3:31

GoogleCodeExporter commented 9 years ago
Fixed for 2.0.4.

Original comment by kevin.s...@gmail.com on 16 Feb 2013 at 5:12

GoogleCodeExporter commented 9 years ago

Original comment by kevin.s...@gmail.com on 6 Mar 2013 at 3:14