pkatlic commented on code in PR #1176:
URL: https://github.com/apache/daffodil/pull/1176#discussion_r1519759531


##########
daffodil-io/src/test/scala/org/apache/daffodil/layers/TestLimitingJavaIOStreams.scala:
##########
@@ -162,52 +136,52 @@ ZyBzb2x1dGlvbnMuCg=="""
     val inputString = beforeDelim + delim + afterDelim
     val inputBytes = inputString.getBytes("utf-8")
     val bais = new ByteArrayInputStream(inputBytes)
-    val rls = new RegexLimitingStream(bais, "\\r\\n(?!(?:\\t|\\ ))", "\r\n", 
utf8)
-    val baos = new ByteArrayOutputStream()
-    var c: Int = -1
-    while ({
-      c = rls.read()
-      c != -1
-    }) {
-      baos.write(c)
-    }
-    baos.close()
-    val actualBeforeDelim = new String(baos.toByteArray())
-    val afterBaos = new ByteArrayOutputStream()
-    while ({
-      c = bais.read()
-      c != -1
-    }) {
-      afterBaos.write(c)
-    }
-    afterBaos.close()
-    val actualAfterDelim = new String(afterBaos.toByteArray())
+    val rls = new RegexLimitingInputStream(bais, "\\r\\n(?!(?:\\t|\\ ))", 
"\r\n", utf8)

Review Comment:
   Since these pattern strings are used several times here, should they be 
defined as a constant?



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