Migration from 1.8 to 2.0, question about encoding in a shared class
Open
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.4k
- Forks
- 627
- Avg merge
- 3d 15m
- Merged PRs (30d)
- 20
Description
More of a question than an issue.
Usage in multiple places is as follows:
A_Message message = ....
send(message)
or
B_Message message = ...
send(message)
Implementation of send() is as follows:
Question: How do I get encoded byte array from the message here? With 1.8, I could simply use message.toByteArray()
void send(Message<?,?> message)
::
// doesn't work because message is not of type A_Message or B_Message
ProtoAdapter.get(message).encode(message);
::
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The question centers on the shared send(Message message) method and the ProtoAdapter.get(message).encode(message) call, but names no repository files or tests. Start by locating those entry points and the 1.8-to-2.0 migration guidance; done would be documented, confirmed instructions for obtaining encoded bytes from the shared message type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- api
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100