stevedlawrence commented on a change in pull request #219: Ensure InputStreams 
created by includes/imports are closed
URL: https://github.com/apache/incubator-daffodil/pull/219#discussion_r284830771
 
 

 ##########
 File path: 
daffodil-lib/src/main/scala/org/apache/daffodil/xml/DaffodilXMLLoader.scala
 ##########
 @@ -302,35 +306,30 @@ object DFDLCatalogResolver {
   def get = d.get
 }
 
-class Input(var pubId: String, var sysId: String, var inputStream: 
BufferedInputStream)
+class InputStreamLSInput(var pubId: String, var sysId: String, inputStream: 
InputStream)
   extends LSInput {
 
   var myBaseURI: String = null
 
+  def getBaseURI = myBaseURI
   def getPublicId = pubId
+  def getSystemId = sysId
+
+  def setBaseURI(baseURI: String) = myBaseURI = baseURI
   def setPublicId(publicId: String) = pubId = publicId
-  def getBaseURI = myBaseURI
-  def getByteStream = null
+  def setSystemId(systemId: String) = sysId = systemId
+
+  def getByteStream = inputStream
   def getCertifiedText = false
   def getCharacterStream = null
   def getEncoding = null
-  def getStringData = {
-    this.synchronized {
-      val input: Array[Byte] = new Array[Byte](inputStream.available())
-      inputStream.read(input)
-      val contents = new String(input)
-      contents
-    }
-  }
-  def setBaseURI(baseURI: String) = myBaseURI = baseURI
+  def getStringData = null
 
 Review comment:
   Yep, will do.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to