mkeskells commented on code in PR #3776:
URL: https://github.com/apache/avro/pull/3776#discussion_r3460707185


##########
lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java:
##########
@@ -126,6 +129,22 @@ public abstract class Decoder {
    */
   public abstract ByteBuffer readBytes(ByteBuffer old) throws IOException;
 
+  /**
+   * Reads a byte-string written by {@link Encoder#writeBytes}.
+   * <p>
+   * This is useful when you want to avoid the creation of a ByteBuffer, and 
only
+   * want the byte[], e.g.:
+   *
+   * <pre>
+   * ByteBuffer buffer = decoder.readBytes(null);
+   * byte[] array = buffer.array();
+   * </pre>
+   *
+   * @throws AvroTypeException If this is a stateful reader and byte-string is 
not
+   *                           the type of the next value to be read
+   */
+  public abstract byte[] readBytes() throws IOException;

Review Comment:
   @Fokko @opwvhk please advise if I need to generate a default implementation 
here



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to