More validation

This commit is contained in:
Trustin Lee 2009-06-16 08:09:12 +00:00
parent c2169f2b73
commit bba5b7bd42

View File

@ -67,6 +67,11 @@ public class ChunkedFile implements ChunkedInput {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"length: " + length + " (expected: 0 or greater)"); "length: " + length + " (expected: 0 or greater)");
} }
if (chunkSize <= 0) {
throw new IllegalArgumentException(
"chunkSize: " + chunkSize +
" (expected: a positive integer)");
}
this.file = file; this.file = file;
this.offset = startOffset = offset; this.offset = startOffset = offset;