code: public static byte[] readByteArray(InputStream input) throws IOException {
          ByteArrayOutputStream output = new ByteArrayOutputStream();
          copy(input, output);
          return output.toByteArray();
      }
docs: <p>readByteArray.</p>
  
  @param input a {@link java.io.InputStream} object.
  @return an array of byte.
  @throws java.io.IOException if any.