mccheah commented on a change in pull request #80: Introduce metadata for 
encrypting table data files
URL: https://github.com/apache/incubator-iceberg/pull/80#discussion_r248825239
 
 

 ##########
 File path: core/src/main/java/com/netflix/iceberg/util/ByteBuffers.java
 ##########
 @@ -0,0 +1,38 @@
+package com.netflix.iceberg.util;
+
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+
+public class ByteBuffers {
+
+  public static ByteBuffer copy(ByteBuffer toCopy) {
+    return ByteBuffer.wrap(toByteArray(toCopy));
+  }
+
+  public static byte[] toByteArray(ByteBuffer buffer) {
 
 Review comment:
   This is taken from `SerializableByteBufferMap`. One implementation detail 
that we should review throughout this patch is how to avoid copying bytes as 
much as possible. I over-compensate for correctness by defensive copying these 
byte arrays frequently. We might be able to get away with something more 
efficient in some places.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to