Refine some codes in Tools.copy(InputStream, File).

Signed-off-by: 核心力量 <kernelforce@gmail.com>