rdblue commented on code in PR #16748:
URL: https://github.com/apache/iceberg/pull/16748#discussion_r3391423797


##########
api/src/main/java/org/apache/iceberg/variants/VariantUtil.java:
##########
@@ -33,78 +33,6 @@ class VariantUtil {
 
   private VariantUtil() {}
 
-  /** A hacky absolute put for ByteBuffer */
-  static int writeBufferAbsolute(ByteBuffer buffer, int offset, ByteBuffer 
toCopy) {
-    int originalPosition = buffer.position();
-    buffer.position(offset);
-    ByteBuffer copy = toCopy.duplicate();
-    buffer.put(copy); // duplicate so toCopy is not modified
-    buffer.position(originalPosition);
-    Preconditions.checkArgument(copy.remaining() <= 0, "Not fully written");
-    return toCopy.remaining();
-  }
-
-  static void writeByte(ByteBuffer buffer, int value, int offset) {
-    buffer.put(buffer.position() + offset, (byte) (value & 0xFF));
-  }
-
-  static void writeLittleEndianUnsigned(ByteBuffer buffer, int value, int 
offset, int size) {
-    int base = buffer.position() + offset;
-    switch (size) {
-      case 4:
-        buffer.putInt(base, value);
-        return;
-      case 3:
-        buffer.putShort(base, (short) (value & 0xFFFF));
-        buffer.put(base + 2, (byte) ((value >> 16) & 0xFF));
-        return;
-      case 2:
-        buffer.putShort(base, (short) (value & 0xFFFF));
-        return;
-      case 1:
-        buffer.put(base, (byte) (value & 0xFF));
-        return;
-    }
-
-    throw new IllegalArgumentException("Invalid size: " + size);
-  }
-
-  static byte readLittleEndianInt8(ByteBuffer buffer, int offset) {
-    return buffer.get(buffer.position() + offset);
-  }
-
-  static short readLittleEndianInt16(ByteBuffer buffer, int offset) {
-    return buffer.getShort(buffer.position() + offset);
-  }
-
-  static int readByte(ByteBuffer buffer, int offset) {
-    return buffer.get(buffer.position() + offset) & 0xFF;
-  }
-
-  static int readLittleEndianUnsigned(ByteBuffer buffer, int offset, int size) 
{
-    int base = buffer.position() + offset;
-    switch (size) {
-      case 4:
-        return buffer.getInt(base);
-      case 3:
-        return (((int) buffer.getShort(base)) & 0xFFFF) | ((buffer.get(base + 
2) & 0xFF) << 16);
-      case 2:
-        return ((int) buffer.getShort(base)) & 0xFFFF;
-      case 1:
-        return buffer.get(base) & 0xFF;
-    }
-
-    throw new IllegalArgumentException("Invalid size: " + size);
-  }
-
-  static int readLittleEndianInt32(ByteBuffer buffer, int offset) {
-    return buffer.getInt(buffer.position() + offset);
-  }
-
-  static long readLittleEndianInt64(ByteBuffer buffer, int offset) {
-    return buffer.getLong(buffer.position() + offset);
-  }
-
   static float readFloat(ByteBuffer buffer, int offset) {

Review Comment:
   I don't think so because they are only used here. We can always move them 
later, but these weren't shared originally because we didn't have other parts 
of the codebase that needed them.



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