You're better off using commons-io which has IOUtils.copy...