beliefer commented on a change in pull request #30981:
URL: https://github.com/apache/spark/pull/30981#discussion_r552352809
##########
File path:
common/unsafe/src/main/java/org/apache/spark/unsafe/types/ByteArray.java
##########
@@ -101,4 +101,117 @@ public static long getPrefix(byte[] bytes) {
}
return result;
}
+
+ /**
+ * Trims bytes representing spaces from both ends of this byte array.
+ *
+ * @param srcArr the source byte array
+ * @return this byte array with no bytes representing spaces at the start or
end
+ */
+ public static byte[] trim(byte[] srcArr) {
+ return trim(srcArr, " ".getBytes());
Review comment:
Good idea.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]