This is an automated email from the ASF dual-hosted git repository.

gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c12dd9  Add javadocs to StringUtils.fromUtf8. (#11881)
1c12dd9 is described below

commit 1c12dd97dc39c447027baf578177fd5ea0a989a9
Author: Gian Merlino <[email protected]>
AuthorDate: Fri Nov 5 15:27:24 2021 -0700

    Add javadocs to StringUtils.fromUtf8. (#11881)
    
    They clarify that the methods advance the position of the buffer.
---
 .../main/java/org/apache/druid/java/util/common/StringUtils.java  | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git 
a/core/src/main/java/org/apache/druid/java/util/common/StringUtils.java 
b/core/src/main/java/org/apache/druid/java/util/common/StringUtils.java
index 97fb433..b076f98 100644
--- a/core/src/main/java/org/apache/druid/java/util/common/StringUtils.java
+++ b/core/src/main/java/org/apache/druid/java/util/common/StringUtils.java
@@ -88,6 +88,10 @@ public class StringUtils
     }
   }
 
+  /**
+   * Decodes a UTF-8 String from {@code numBytes} bytes starting at the 
current position of a buffer.
+   * Advances the position of the buffer by {@code numBytes}.
+   */
   public static String fromUtf8(final ByteBuffer buffer, final int numBytes)
   {
     final byte[] bytes = new byte[numBytes];
@@ -95,6 +99,10 @@ public class StringUtils
     return fromUtf8(bytes);
   }
 
+  /**
+   * Decodes a UTF-8 string from the remaining bytes of a buffer.
+   * Advances the position of the buffer by {@link ByteBuffer#remaining()}.
+   */
   public static String fromUtf8(final ByteBuffer buffer)
   {
     return StringUtils.fromUtf8(buffer, buffer.remaining());

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to