chaokunyang commented on code in PR #2414:
URL: https://github.com/apache/fory/pull/2414#discussion_r2378802315
##########
java/fory-format/src/main/java/org/apache/fory/format/encoder/Encoder.java:
##########
@@ -30,11 +30,36 @@
*/
public interface Encoder<T> {
+ /** Decode a buffer with an embedded size. Variants without embedded size
are not compatible. */
T decode(MemoryBuffer buffer);
+ /** Decode a buffer without an embedded size. Variants with embedded size
are not compatible. */
T decode(byte[] bytes);
+ /** Decode a buffer without an embedded size. Variants with embedded size
are not compatible. */
+ T decodeRemaining(MemoryBuffer buffer);
+
+ /** Encode to a buffer without embedded size. Variants with embedded size
are not compatible. */
byte[] encode(T obj);
+ /**
+ * Encode to a buffer with an embedded size. Variants without embedded size
are not compatible.
+ */
void encode(MemoryBuffer buffer, T obj);
+
+ /**
+ * Encode to a buffer without an embedded size. Variants with embedded size
are not compatible.
+ * Returns number of bytes written to the buffer.
+ */
+ int bareEncode(MemoryBuffer buffer, T obj);
Review Comment:
Is it possible to merge `bareEncode` and `encode` into one method?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]