code: public static byte[] toByteArray(InputStream stream) throws IOException {
  		return org.apache.commons.io.IOUtils.toByteArray(stream);
  	}
docs: <p>
  Get the contents of an InputStream as a byte[].
  </p>
  <p>
  This method buffers the input internally, so there is no need to use a
  BufferedInputStream.
  </p>
  
  @param stream
  the InputStream to read from
  @return the requested byte array
  @throws NullPointerException
  if the input is null
  @throws IOException
  if an I/O error occurs