zipkin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-zipkin] adriancole commented on a change in pull request #2589: Makes SpanBytesDecoder work on ByteBuffer
Date Sun, 12 May 2019 11:07:53 GMT
adriancole commented on a change in pull request #2589: Makes SpanBytesDecoder work on ByteBuffer
URL: https://github.com/apache/incubator-zipkin/pull/2589#discussion_r283131646
 
 

 ##########
 File path: zipkin/src/main/java/zipkin2/internal/JsonCodec.java
 ##########
 @@ -44,14 +44,14 @@
  * this should be easy to justify as these objects don't change much at all.
  */
 public final class JsonCodec {
+  static final Charset UTF_8 = Charset.forName("UTF-8");
+
   // Hides gson types for internal use in other submodules
   public static final class JsonReader {
     final com.google.gson.stream.JsonReader delegate;
 
-    JsonReader(byte[] bytes) {
-      delegate =
-        new com.google.gson.stream.JsonReader(
-          new InputStreamReader(new ByteArrayInputStream(bytes), UTF_8));
+    JsonReader(ReadBuffer buffer) {
+      delegate = new com.google.gson.stream.JsonReader(new InputStreamReader(buffer, UTF_8));
 
 Review comment:
   our buffer type now backports inputstream so it works directly with gson

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message