jadams-tresys commented on code in PR #878:
URL: https://github.com/apache/daffodil/pull/878#discussion_r1030425122


##########
daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala:
##########
@@ -1482,6 +1518,74 @@ object Main {
         }
       }
 
+      case Some(conf.encodeEXI) => {
+        val encodeOpts = conf.encodeEXI
+        val channel = encodeOpts.output.toOption match {
+          case Some("-") | None => Channels.newChannel(STDOUT)
+          case Some(file) => new FileOutputStream(file).getChannel()
+        }
+        val output = Channels.newOutputStream(channel)
+
+        val inputStream = encodeOpts.infile.toOption match {
+          case Some("-") | None => STDIN
+          case Some(file) => {
+            val f = new File(file)
+            new FileInputStream(f)
+          }
+        }
+        val input = new InputSource(inputStream)
+
+        val exiFactory = {
+          if (encodeOpts.schema.isDefined)
+            getExiFactoryOpt(InfosetType.EXISA, encodeOpts.schema.toOption)
+          else
+            getExiFactoryOpt(InfosetType.EXI, encodeOpts.schema.toOption)
+        }

Review Comment:
   I'll let you get your commit merged before pushing mine up.  I'll take care 
of resolving any conflicts that come up.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to