why throw here? if it's larger than maxSize, we truncate down to maxSize.