jtjeferreira commented on code in PR #308:
URL: https://github.com/apache/pekko-grpc/pull/308#discussion_r1606598841


##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/Gzip.scala:
##########
@@ -24,13 +24,13 @@ object Gzip extends Codec {
   override def compress(uncompressed: ByteString): ByteString = {
     val baos = new ByteArrayOutputStream(uncompressed.size)
     val gzos = new GZIPOutputStream(baos)
-    try gzos.write(uncompressed.toArray)
+    try gzos.write(uncompressed.toArrayUnsafe())
     finally gzos.close()
     ByteString.fromArrayUnsafe(baos.toByteArray)
   }
 
   override def uncompress(compressed: ByteString): ByteString = {
-    val gzis = new GZIPInputStream(new 
ByteArrayInputStream(compressed.toArray))
+    val gzis = new GZIPInputStream(new 
ByteArrayInputStream(compressed.toArrayUnsafe()))

Review Comment:
   > We need to use MethodHandles to still support Pekko 1.0 (asInputStream is 
only in Pekko 1.1).
   
   thats unfortunate 
   
   > this was reverted because of a bug in the hpack code - 
https://github.com/twitter/hpack/issues/43
   
   last commit of that library was 5 years ago. also it 
[seems](https://github.com/twitter/hpack/issues/31) to be deprecated  
   



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