This just lets the caller give you the byte[] and offset into byte[] to fill in the value. Usually, this one is just implemented, and the one above calls into this one, but allocates a buffer first. I think you should be able to pre-calc the size based on the baseType and object.