code: public static byte[] toByteArray(InputStream is) throws IOException {
  		ByteArrayOutputStream bao = new ByteArrayOutputStream();
  		IO.copyAndCloseBoth(is, bao);
  		return bao.toByteArray();
  	}
docs: Similar to {@link IOUtils#toByteArray(InputStream)} but closes the stream.