Use getCachedBytes in IndexPack to avoid an unnecessary copy
This is deep within the library code, where we know we won't overwrite
the cached buffer for an object. Using getCachedBytes saves a full
array copy while fixing a thin pack and appending whole objects. The
extra copy isn't so much an issue of CPU time as it is about creating
unnecessary temporary garbage for the GC to clean up.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>