Skip to content

Deserializer requires too much data #210

@antrv

Description

@antrv

I serialize an object directly into NetworkStream and on another socket side I try to deserialize this object from NetworkStream.

The serialized object size is 4 bytes. When I call MessagePackSerializer.Deserialize(_stream) it calls _stream.Read method 2 times.
In the first time it calls _stream.Read(buffer, 0, 65535) and this call returns 4 bytes,
in the second time it calls _stream.Read(buffer, 0, 65531) and the application hangs because there is no more data in the stream.

I think that deserializer requires more data that it needs to deserialize the object.

Is there any possibility to change the deserializer behavior in this case without involving any additional byte arrays and data copying? Or some fixes need to be made in the library?

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