Skip to content

Cannot deserialize byte[] in class #2230

@kukuro-kt

Description

@kukuro-kt

Bug description

Cannot deserialize byte[] in class like:

    [MessagePackObject]
    class Ms {
        [Key(0)] public byte[] rgb;
    }

Then,

var input = new byte[] { 145, 147, 127, 127, 127 };
var byte_array = MessagePackSerializer.Deserialize<Ms>(input);

Expected behavior

deserialize success

Actual behavior

Unexpected msgpack code 147 (fixarray) encountered.

  • Version used: 3.1.4
  • Runtime: Unity

Additional context

If use List<byte> instead of byte[], it will run correctly.

Maybe related to #1165

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions