You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Pete Wyckoff <pw...@facebook.com> on 2008/11/08 03:13:25 UTC

Can FSDataInputStream.read return 0 bytes and if so, what does that mean?

The javadocs says reads up to size bytes. What happens if it returns < 0
(presumably an error) or 0 bytes (??)

Thanks, pete


Re: Can FSDataInputStream.read return 0 bytes and if so, what does that mean?

Posted by Dhruba Borthakur <dh...@gmail.com>.
It can return 0 if and only if the requested size was zero. For EOF,
it should return -1.

dhruba

On Fri, Nov 7, 2008 at 8:09 PM, Pete Wyckoff <pw...@facebook.com> wrote:
> Just want to ensure 0 iff EOF or the requested #of bytes was 0.
>
> On 11/7/08 6:13 PM, "Pete Wyckoff" <pw...@facebook.com> wrote:
>
>
>
> The javadocs says reads up to size bytes. What happens if it returns < 0
> (presumably an error) or 0 bytes (??)
>
> Thanks, pete
>
>
>
>

Re: Can FSDataInputStream.read return 0 bytes and if so, what does that mean?

Posted by Pete Wyckoff <pw...@facebook.com>.
Just want to ensure 0 iff EOF or the requested #of bytes was 0.

On 11/7/08 6:13 PM, "Pete Wyckoff" <pw...@facebook.com> wrote:



The javadocs says reads up to size bytes. What happens if it returns < 0
(presumably an error) or 0 bytes (??)

Thanks, pete