If there is a guava util here, prefer that over apache commons.  Looks like there some copy bits on ByteStreams helper in guava.