mbeckerle commented on code in PR #1191:
URL: https://github.com/apache/daffodil/pull/1191#discussion_r1542141981
##########
daffodil-test/src/test/scala/org/apache/daffodil/runtime1/layers/AISPayloadArmoringLayer.scala:
##########
@@ -183,17 +113,25 @@ class AISPayloadArmoringOutputStream(jos:
java.io.OutputStream) extends OutputSt
override def close(): Unit = {
if (!closed) {
- val ba = baos.toByteArray()
- val dis = InputSourceDataInputStream(ba)
- val finfo = new FormatInfoForAISDecode()
- val cb = CharBuffer.allocate(256)
- while ({ val numDecoded = dec.decode(dis, finfo, cb); numDecoded > 0 }) {
- cb.flip()
- IOUtils.write(cb, jos, iso8859)
- cb.clear()
+ val ba = baos.toByteArray
+ using(InputSourceDataInputStream(ba)) { dis =>
+ val finfo = FormatInfoForAISDecode
+ val cb = CharBuffer.allocate(256)
+ //
+ // TODO: This is not a supportable API. We want to reuse the
bitsCharset features of daffodil
+ // for this non-byte-sized charset decoding. But this finfo object (a
trait on the ParseOrUnparseState)
+ // should not be part of the API
Review Comment:
I will clarify. I'm talking about how this AIS layer is using the
BitsCharset which is an internal thing (now anyway) so while the layer could be
built in to Daffodil, it can't be written by an outsider without depending on
Daffodil internals.
--
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]