You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2024/08/28 10:25:46 UTC

(pulsar) branch branch-3.0 updated: [fix] StatsOutputStream: add string write function (#308) (#23227)

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

lhotari pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 4e460c80515 [fix] StatsOutputStream: add string write function (#308) (#23227)
4e460c80515 is described below

commit 4e460c80515000e0903133620f22e1b5f0770270
Author: Andrey Yegorov <86...@users.noreply.github.com>
AuthorDate: Mon Aug 26 13:32:58 2024 -0700

    [fix] StatsOutputStream: add string write function (#308) (#23227)
    
    Co-authored-by: Paul Gier <pa...@datastax.com>
    (cherry picked from commit cd3519aea7c9f341e40b1343112b0b7d41a6c508)
---
 .../org/apache/pulsar/common/util/SimpleTextOutputStream.java    | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pulsar-common/src/main/java/org/apache/pulsar/common/util/SimpleTextOutputStream.java b/pulsar-common/src/main/java/org/apache/pulsar/common/util/SimpleTextOutputStream.java
index 9bf6302f50f..d3f319bd958 100644
--- a/pulsar-common/src/main/java/org/apache/pulsar/common/util/SimpleTextOutputStream.java
+++ b/pulsar-common/src/main/java/org/apache/pulsar/common/util/SimpleTextOutputStream.java
@@ -56,6 +56,15 @@ public class SimpleTextOutputStream {
         return this;
     }
 
+    public SimpleTextOutputStream write(String s) {
+        if (s == null) {
+            return this;
+        }
+
+        buffer.writeCharSequence(s, CharsetUtil.UTF_8);
+        return this;
+    }
+
     public SimpleTextOutputStream write(CharSequence s) {
         if (s == null) {
             return this;