Myron,
Thank you for pointing this. it looks like we violate stream contract
because regular Java ObjectOutputStream will return -1 in this case.
Forwarding to dev list.

Igniters,
As Myron mentioned, out implementation of ObjectInput returns 0 when
performing ObjectInput.read(byte[]) and there is no more array data
available. To the contrast, Java's ObjectInputStream returns -1 in this
case.
Looks like we should fix that.

Thoughts?

Vladimir.

On Mon, Feb 15, 2016 at 10:32 PM, Myron Chelyada <myron.chely...@gmail.com>
wrote:

> Hello Alexey,
>
> This is actually not real code but just extracted part for test. That's
> why it looks incorrect.
> And I've already captured infinite loop because of 0 being returned. And
> imagine use case when I need to read until end of stream. So question is
> why 0 is returned but not -1 (according to API).
>
>
> 2016-02-15 21:10 GMT+02:00 Dmitriy Setrakyan <dsetrak...@apache.org>:
>
>> Alexey, is this something that Ignite could prevent automatically?
>>
>> On Mon, Feb 15, 2016 at 10:17 AM, Alexey Goncharuk <
>> alexey.goncha...@gmail.com> wrote:
>>
>>> A little correction: in this particular case inputStream does return 0
>>> which leads to an infinite loop, however, generally this may be not the
>>> case, so the implementation should not read beyond object boundary anyways.
>>>
>>
>>
>

Reply via email to