sijie commented on a change in pull request #5123: Modify the schema decode 
method can decode ByteBuf
URL: https://github.com/apache/pulsar/pull/5123#discussion_r322407811
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonReader.java
 ##########
 @@ -48,9 +48,9 @@ public GenericJsonReader(byte[] schemaVersion, List<Field> 
fields){
         this.schemaVersion = schemaVersion;
     }
     @Override
-    public GenericJsonRecord read(byte[] bytes) {
+    public GenericJsonRecord read(byte[] bytes, int offset, int length) {
         try {
-            JsonNode jn = objectMapper.readTree(new String(bytes, UTF_8));
+            JsonNode jn = objectMapper.readTree(new String(bytes, 0, length, 
UTF_8));
 
 Review comment:
   ```suggestion
               JsonNode jn = objectMapper.readTree(new String(bytes, offset, 
length, UTF_8));
   ```

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


With regards,
Apache Git Services

Reply via email to