Comments (4)
Also
er.close()
src.close()
gives
Exception in thread "XMLEventReader" java.io.IOException: Stream Closed
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:272)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:154)
at java.io.BufferedReader.read(BufferedReader.java:175)
at scala.io.BufferedSource$$anonfun$iter$1$$anonfun$apply$mcI$sp$1.apply$mcI$sp(BufferedSource.scala:38)
at scala.io.Codec.wrap(Codec.scala:68)
at scala.io.BufferedSource$$anonfun$iter$1.apply(BufferedSource.scala:38)
at scala.io.BufferedSource$$anonfun$iter$1.apply(BufferedSource.scala:38)
at scala.collection.Iterator$$anon$9.next(Iterator.scala:162)
at scala.collection.Iterator$$anon$17.hasNext(Iterator.scala:511)
at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:327)
at scala.io.Source.hasNext(Source.scala:226)
at scala.xml.parsing.MarkupParser$class.ch(MarkupParser.scala:104)
at scala.xml.pull.XMLEventReader$Parser.ch(XMLEventReader.scala:59)
at scala.xml.parsing.MarkupParserCommon$class.xName(MarkupParserCommon.scala:116)
at scala.xml.pull.XMLEventReader$Parser.xName(XMLEventReader.scala:59)
it does continue reading without stopping.
from scala-xml.
Knocked out a quick version with StaX, works fine on 4GB file.
https://gist.github.com/fancellu/745bb780adf938c39395
from scala-xml.
I'm not able to verify this problem in a unit test. Nothing has changed in the XMLEventReader
since, and maybe something changed in Java, Scala or the standard library, but probably not much. This test uses an infinite character stream as the source.
@Test
def largeSourceTest = {
val src = new Source {
val str = "<x><y z=''/>9</x>\n"
lazy val elChars: Stream[Char] = str.toList.toStream #::: elChars
protected val iter = elChars.toIterator
}
val reader = new XMLEventReader(src)
reader.take(100)
reader.stop
src.close
}
I even tried running it against a source of an actual 1G file , but I couldn't reproduce the issue.
from scala-xml.
Closing as can't reproduce. If this is still an issue, we'll just need an example.
from scala-xml.
Related Issues (20)
- Publish 2.0.0 HOT 1
- Update CHANGELOG.md HOT 2
- Shut down Gitter room, enable GitHub Discussions? HOT 4
- CDATA in MarkupParser HOT 3
- ConstructingParser does not tolerate start of file whitespace HOT 1
- ConstructingParser throws NoSuchMethodError in Scala 3 HOT 6
- Release 2.0.1
- versionPolicyCheck fails for scalajs-library HOT 4
- ""
- Publish next release (to publish Scala 3 Native support) HOT 15
- Version 2.10 null pointer on toString
- Name predicates: which XML version? HOT 2
- Re-enable versionPolicyCheck HOT 2
- Update CHANGELOG, README? HOT 1
- Drop support for Scala 2.11? HOT 5
- Unused value warnings for XML literals starting with Scala 2.13.9 HOT 1
- Infinite loop caused by mismatched quotes HOT 3
- Roll a 2.2 release HOT 5
- Release 1.3.1 HOT 10
- FactoryAdapter loadDocument() modifies XMLReader and breaks it HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scala-xml.