All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openqa.selenium.IOUtils Maven / Gradle / Ivy

There is a newer version: 2.0b1
Show newest version
package org.openqa.selenium;

import java.io.IOException;
import java.io.InputStream;

public class IOUtils {
  private static final int BUFFER = 4096;

  public static String readFully(InputStream in) throws IOException {
    StringBuilder sb = new StringBuilder();
    byte[] buffer = new byte[BUFFER];
    int length;
    while ((length = in.read(buffer)) != -1) {
      sb.append(new String(buffer, 0, length, "UTF-8"));
    }

    in.close();

    return sb.toString();
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy