There's a variant of Util.pump that takes a length argument:

```java
    public static void pump(final InputStream is, final int max, final DataSink ds, final CompletedCallback callback)
```
See: max.

Specify that, and it won't read more than that many bytes from the stream.