pjfanning commented on code in PR #1085:
URL: https://github.com/apache/incubator-pekko/pull/1085#discussion_r1471635913
##########
actor/src/main/scala-2.12/org/apache/pekko/util/ByteString.scala:
##########
@@ -827,6 +827,14 @@ sealed abstract class ByteString extends IndexedSeq[Byte]
with IndexedSeqOptimiz
*/
def toArrayUnsafe(): Array[Byte] = toArray
+ /**
+ * Return the bytes in this ByteString as an InputStream.
+ *
+ * @return the bytes in this ByteString accessible as an InputStream
+ * @since 1.1.0
+ */
+ def getInputStream(): InputStream = new ByteArrayInputStream(toArrayUnsafe())
Review Comment:
I don't think it is appropriate to have this function return the same cached
result. Input streams are stateful. Each consumer doing reads would be affected
by any other consumer.
--
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]