Skip to content

Commit

Permalink
feat(serialization): ✨ add support for deserializing byte[]
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonboukheir committed Oct 13, 2021
1 parent 0d6e6ab commit 3ef497f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ namespace AlgoSdk
{
public static class AlgoApiSerializer
{
public static T Deserialize<T>(byte[] bytes, ContentType contentType)
{
using var nativeBytes = new NativeArray<byte>(bytes, Allocator.Temp);
return Deserialize<T>(nativeBytes.AsReadOnly(), contentType);
}

public static T Deserialize<T>(NativeArray<byte>.ReadOnly bytes, ContentType contentType)
{
return contentType switch
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3ef497f

Please sign in to comment.