class IoUtils {

  public static byte[] from(
      final InputStream in)
      throws IOException {
    final ByteArrayOutputStream byteOut = new ByteArrayOutputStream();

    final byte[] bytes = new byte[10000];
    int readBytes;
    while (0 < (readBytes = in.read(bytes))) {
      byteOut.write(bytes, 0, readBytes);
    }
    return byteOut.toByteArray();
  }

}