Construct a ByteArrayInputStream from a ByteString without copying bytes or using UnsafeByteStringOperations #291
Labels
enhancement
integration
An issue related to the integration with other libraries or platform-specific APIs
Creating a
ByteArrayInputStream
from aByteString
gives us anInputStream
, which is used in many contexts in java. My understanding is that it is completely safe, since aByteArrayInputStream
only reads the underlyingByteArray
and does not write to it.Currently, I believe there are only two ways to get a
ByteArrayInputStream
from aByteString
:UnsafeByteStringOperations
I am wondering if the library could provide a method to get an
InputStream
(it doesn't necessarily have to be aByteArrayInputStream
, but why not) that is declared safe and doesn't copy bytes.The text was updated successfully, but these errors were encountered: