Allow uncompression at end of file
Allow uncompression at end of file

Asking to read from byte 100 when a file has 50 bytes is an obvious error.
But what if we ask to read from byte 50? What if we ask to read 0 bytes at
byte 50? :-)

Before this patch, code which asked to read from the EOF position would
get an exception. After this patch, it would simply read nothing, without
error. This allows, for example, reading 0 bytes from position 0 on a file
with 0 bytes, which apparently happened in issue #1039...

A read which starts at a position higher than the EOF position still
generates an exception.

Signed-off-by: Nadav Har'El <625169824b719df98706d88646d0aae6f368ae4d@scylladb.com>
Message-Id: <1458137867-10998-1-git-send-email-625169824b719df98706d88646d0aae6f368ae4d@scylladb.com>

avikivity/scylla,scylladb/scylla,raphaelsc/scylla,kjniemi/scylla,raphaelsc/scylla,raphaelsc/scylla,scylladb/scylla,scylladb/scylla,kjniemi/scylla,kjniemi/scylla,duarten/scylla,avikivity/scylla,avikivity/scylla,duarten/scylla,duarten/scylla,scylladb/scylla