On Tue, Mar 17, 2009 at 10:58, Nigel Tao <[email protected]> wrote:
> On Mon, Mar 16, 2009 at 16:47, Aaron Boodman <[email protected]> wrote:
>> I know. My point is that it seems like getBytes() would be more useful.
>
> Ah, I see what you mean now. Yes, I think you're right. Let me fix that...

This CL has been updated. blob.getBytes takes a required int64 offset
and an optional int64 length, just like blob.slice(offset [, length]),
and returns an array of ints.

If there are no exceptions thrown, then blob.getBytes(o, l) should be
equivalent to blob.slice(o, l).getBytes(0). However, getBytes may
throw exceptions where slice does not, since getBytes will actually do
the I/O, whereas slice simply makes a cheap view of an existing blob,
and for example you can make a slice that goes beyond the length of
the original blob (whereas getBytes beyond the end of the original
blob will cause an exception). Furthermore, getBytes has a maximum
length that it considers reasonable, set arbitrarily at 1024.

Reply via email to