BinaryPack icon indicating copy to clipboard operation
BinaryPack copied to clipboard

Serialization of string

Open puschie286 opened this issue 3 years ago • 0 comments

Hi,

the readme says that binarypack supports primary types like string but i dont get it to work with string. it work very well for all other types but string seems to be the only exception

my approch was:

byte[] serialize = BinaryConverter.Serialize( "test" );
string back = BinaryConverter.Deserialize<string>( serialize );

which doesnt compile because of Error CS0310 : 'string' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'BinaryConverter.Serialize<T>(T)'

puschie286 avatar Jun 21 '22 16:06 puschie286