On Jul 2, 2009, at 6:05 PM, william kinney wrote:

My real issue is that in writing my own RecordReader, I am trying to
set the byte[] for a BytesWriteable that is passed in. This works fine
for set(byte[], int, int), but then doing a get() on it later in the
Map phase I get unwanted buffered data that appears to because the
set(byte[], int, int) adds buffered capacity of the magnitude 3/2 *
size.

In any case, with BytesWritable, you need to assume that the backing array is longer than the data. You always need to do:

bw.getBytes(), 0, bw.getLength()

to get the bytes and the valid range of data. Almost all contexts in Java allow you to specify byte[], offset, length...

-- Owen

Reply via email to