sdk-csharp icon indicating copy to clipboard operation
sdk-csharp copied to clipboard

Centralize handling of strings and bytes arrays for event formatters

Open jskeet opened this issue 3 years ago • 3 comments

All event formatters are expected to handle strings and byte arrays. We should make it really easy for them to do so via common code, e.g. protected methods in CloudEventFormatter.

jskeet avatar May 04 '21 14:05 jskeet

This hasn't been done for 2.0; I still have the Protobuf event formatter to finish though, so when that's done it will give us more data.

jskeet avatar Jun 03 '21 17:06 jskeet

Would this potentially let us inject things like https://github.com/microsoft/Microsoft.IO.RecyclableMemoryStream/blob/master/src/RecyclableMemoryStream.cs into the serialization? and remove the use of Encoding.GetBytes and Encoding.GetString etc? It's hard for me to see how I could do this without cloning the current class entirely

bencyoung-Fignum avatar May 05 '23 08:05 bencyoung-Fignum

@bencyoung-Fignum: Honestly couldn't say yet - but maybe.

jskeet avatar May 05 '23 08:05 jskeet