Don't truncate data slice unless necessary. I think NSData -subdataWithRange: is smart enough to handle this case (i.e. returning the same NSData given as input when range spans the original buffer size), but let's check for it anyway.