https://kotlinlang.org logo
#serialization
Title
# serialization
t

TwoClocks

08/18/2020, 4:41 AM
So if I have two message in one ByteArray (Say I did a network read and got back 2 messages at once), how does the decoder tell me how many bytes were consumed in the byte array? How do I decode the second message?
As a follow up question how can I tell if I only have a partial message? Meaning, I should go back the socket to read the rest before trying to decode again?
3 Views