divjotarora commented on code in PR #3702:
URL: https://github.com/apache/parquet-java/pull/3702#discussion_r3857586732


##########
parquet-column/src/main/java/org/apache/parquet/io/api/Binary.java:
##########
@@ -587,7 +587,7 @@ public short get2BytesLittleEndian() {
         throw new IllegalArgumentException("length must be 2");
       }
 
-      return value.order(ByteOrder.LITTLE_ENDIAN).getShort(offset);
+      return value.duplicate().order(ByteOrder.LITTLE_ENDIAN).getShort(offset);

Review Comment:
   Can we do something similar as `ByteArraySliceBackedBinary` and avoid 
duplicating?
   
   ```
   return (short) (((value.get(offset + 1) & 0xff) << 8) | (value.get(offset) & 
0xff));
   ```



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