You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/07/20 07:52:55 UTC

[GitHub] [pulsar] tjiuming commented on a diff in pull request #16659: [schema][client][improve] Add decode InputStream for Schema

tjiuming commented on code in PR #16659:
URL: https://github.com/apache/pulsar/pull/16659#discussion_r925289248


##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Schema.java:
##########
@@ -120,6 +123,36 @@ default T decode(byte[] bytes, byte[] schemaVersion) {
         return decode(bytes);
     }
 
+    /**
+     * Decode a byte array into an object using the schema definition and deserializer implementation.
+     *
+     * @param input the inputstream to decode
+     * @return the deserialized object
+     */
+    default T decode(InputStream input) {
+        try {
+            return decode(IOUtils.readAllBytes(input));

Review Comment:
   There is no apache-commons-io dependency in client-api, so it can't be work. same as below



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org