- Notifications
You must be signed in to change notification settings - Fork 170
Open
Description
Hi.
It isn't issue but suggestion\question.
I want to have custom implementation of array container deserialization (without legth) (server optimization proposes).
To implement it i want to have 2 extensions (e.g. 120 - array start [, and 121 - array end ]).
So Can i implement something similar? Can i controll offset of main buffer from extension?
Expectation example:
extensionCodec.register({ type: 121, decode: (data: Uint8Array) => { return {arrayEnd : true}; }, }); extensionCodec.register({ type: 120, decode: (data: Uint8Array) => { const arr = []; while(true) { let arrayElement = decode(data); // returns some obj with offset shift from main data buffer. if(arrayElement?.arrayEnd) break; arr.push(arrayElement); } return arr ; }, }); Metadata
Metadata
Assignees
Labels
No labels