Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Coder encode/decode documentation. #28596

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ public String toString() {

/**
* Encodes the given value of type {@code T} onto the given output stream.
* Multiple elements can be encoded next to each other on the output stream,
* each coder should encode information to know how many bytes to read when decoding.
* A common approach is to prefix the encoding with the elemen's encoded length.
arunpandianp marked this conversation as resolved.
Show resolved Hide resolved
*
* @throws IOException if writing to the {@code OutputStream} fails for some reason
* @throws CoderException if the value could not be encoded for some reason
Expand All @@ -135,6 +138,9 @@ public void encode(T value, OutputStream outStream, Context context)
/**
* Decodes a value of type {@code T} from the given input stream in the given context. Returns the
* decoded value.
* Multiple elements can be encoded next to each other on the input stream,
* each coder should encode information to know how many bytes to read when decoding.
* A common approach is to prefix the encoding with the elemen's encoded length.
arunpandianp marked this conversation as resolved.
Show resolved Hide resolved
*
* @throws IOException if reading from the {@code InputStream} fails for some reason
* @throws CoderException if the value could not be decoded for some reason
Expand Down
Loading