This commit is contained in:
Winston Li 2017-08-02 20:58:15 +01:00
parent ad687e5f58
commit fd743d1bf3

View file

@ -101,8 +101,9 @@ public class Tar {
}
long size = e.getSize();
Preconditions.checkArgument(
size > 0 && size < Integer.MAX_VALUE,
"file too big: tarTo should have thrown an IOException"
size >= 0 && size <= Integer.MAX_VALUE,
"file too big (" + size + " B): " +
"tarTo should have thrown an IOException"
);
try (OutputStream out = new FileOutputStream(f)) {
/* TarInputStream pretends each