mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix code
This commit is contained in:
parent
82be78e2fd
commit
1141d57cfd
@ -6,9 +6,9 @@ import cn.hutool.core.io.stream.EmptyOutputStream;
|
|||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.IOException;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.util.zip.CRC32;
|
import java.util.zip.CRC32;
|
||||||
import java.util.zip.CheckedInputStream;
|
import java.util.zip.CheckedInputStream;
|
||||||
import java.util.zip.Checksum;
|
import java.util.zip.Checksum;
|
||||||
@ -57,8 +57,8 @@ public class ChecksumUtil {
|
|||||||
throw new IllegalArgumentException("Checksums can't be computed on directories");
|
throw new IllegalArgumentException("Checksums can't be computed on directories");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return checksum(new FileInputStream(file), checksum);
|
return checksum(Files.newInputStream(file.toPath()), checksum);
|
||||||
} catch (final FileNotFoundException e) {
|
} catch (final IOException e) {
|
||||||
throw new IORuntimeException(e);
|
throw new IORuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user