Skip to content

Commit

Permalink
add throws TooMuchDataException to readAndClose as part of TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmoten committed Aug 10, 2017
1 parent 960985e commit 5c23887
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public void data(InputStream is) throws RejectException, TooMuchDataException, I
}
}

private static byte[] readAndClose(InputStream is) throws IOException {
private static byte[] readAndClose(InputStream is) throws IOException, TooMuchDataException {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
byte[] buffer = new byte[8192];
int n;
try {
// TODO honour max message size by throwing a TooMuchDataException when
// TODO honour max message size by throwing a TooMuchDataException when
// bytes.length() is too big
while ((n = is.read(buffer)) != -1) {
bytes.write(buffer, 0, n);
Expand Down

0 comments on commit 5c23887

Please sign in to comment.