MCPcopy
hub / github.com/google/guava / readFirstLine

Method readFirstLine

android/guava/src/com/google/common/io/Files.java:518–525  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 3

testLineReadingMethod · 0.95
testReadFirstLineMethod · 0.45
testReadFirstLineMethod · 0.45

Calls 1

asCharSourceMethod · 0.95

Tested by 3

testLineReadingMethod · 0.76
testReadFirstLineMethod · 0.36
testReadFirstLineMethod · 0.36