// Get the bytes of the data without a lot
// of resizing and GC. The BAAOutputStream
// keeps the data in non-contiguous byte buffers.
BAAOutputStream baaos = new BAAOutputStream();
BufferUtils.inputStream2OutputStream(in, baaos);
partContent = new PartContentOnMemory(baaos.buffers(), baaos.length());
} else {
// We need to read the input stream to determine whether
// the size is bigger or smaller than the threshold.
BAAOutputStream baaos = new BAAOutputStream();
int count = BufferUtils.inputStream2OutputStream(in, baaos, thresholdSize);