mdedetrich commented on code in PR #74:
URL: 
https://github.com/apache/incubator-pekko-connectors/pull/74#discussion_r1143296502


##########
file/src/test/scala/docs/scaladsl/ExecutableUtils.scala:
##########
@@ -58,10 +57,9 @@ object ExecutableUtils {
     finally stream.close()
   }
 
-  @nowarn("msg=deprecated")
   private def readStream(stream: InputStream): ByteString = {
     val reader = new BufferedInputStream(stream)
-    try ByteString(Stream.continually(reader.read).takeWhile(_ != 
-1).map(_.toByte).toArray)
+    try ByteString(Iterator.continually(reader.read).takeWhile(_ != 
-1).map(_.toByte).toArray)

Review Comment:
   So I realized what the underlying problem was, it turns out that 
specifically for Scala 2.12, `ByteString` is missing the apply method for an 
`Iterator` where as this exists in Scala 2.13. This is likely an oversight and 
a PR at Pekk was created at https://github.com/apache/incubator-pekko/pull/257 
to resolve this.
   
   When that PR lands its possible to remove the `.toArray`, in any case both 
variants are equivalent to eachother because internally in the 
`ByteString.apply` it converts it to an Array.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to