Package org.openqa.selenium.io
Class Read
java.lang.Object
org.openqa.selenium.io.Read
Helper methods to read input stream and return the result in different formats.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringresourceAsString(Class<?> resourceOwner, String resource) static StringresourceAsString(String resource) Deprecated.static byte[]Equivalent to Java's built-in methodInputStream.readAllBytes().static StringtoString(InputStream in)
-
Method Details
-
toByteArray
Equivalent to Java's built-in methodInputStream.readAllBytes(). But the latter has a bug in Java 11 (fixed only in Java 14+).This method can be removed when we upgrade to Java 17+.
- Throws:
IOException
-
toString
- Throws:
IOException
-
resourceAsString
Deprecated.UseresourceAsString(Class, String)insteadThis method might not work in OSGI environment. -
resourceAsString
-
resourceAsString(Class, String)instead