Reads all characters from a {@link Readable} object into a {@link String}. Does not close the {@code Readable}. <p><b>Java 25+ users:</b> If the input is a {@link Reader}, prefer {@link Reader#readAllAsString()}. @param r the object to read from @return a string containing all the characters @thro
(Readable r)
| 160 | * @throws IOException if an I/O error occurs |
| 161 | */ |
| 162 | public static String toString(Readable r) throws IOException { |
| 163 | return toStringBuilder(r).toString(); |
| 164 | } |
| 165 | |
| 166 | /** |
| 167 | * Reads all characters from a {@link Readable} object into a new {@link StringBuilder} instance. |