Reads the first line from a file. The line does not include line-termination characters, but does include other leading and trailing whitespace. @param file the file to read from @param charset the charset used to decode the input stream; see {@link StandardCharsets} for helpful predefined cons
(File file, Charset charset)
| 516 | * @deprecated Prefer {@code asCharSource(file, charset).readFirstLine()}. |
| 517 | */ |
| 518 | @Deprecated |
| 519 | @InlineMe( |
| 520 | replacement = "Files.asCharSource(file, charset).readFirstLine()", |
| 521 | imports = "com.google.common.io.Files") |
| 522 | public |
| 523 | static @Nullable String readFirstLine(File file, Charset charset) throws IOException { |
| 524 | return asCharSource(file, charset).readFirstLine(); |
| 525 | } |
| 526 | |
| 527 | /** |
| 528 | * Reads all of the lines from a file. The lines do not include line-termination characters, but |