Reads the first link of this source as a string. Returns null if this source is empty. Like BufferedReader, this method breaks lines on any of \n, \r or \r\n, does not include the line separator in the returned line and does not consider there to be an ext
()
| 259 | */ |
| 260 | |
| 261 | @Nullable |
| 262 | public String readFirstLine() throws IOException { |
| 263 | Closer closer = Closer.create(); |
| 264 | try { |
| 265 | BufferedReader reader = closer.register(openBufferedStream()); |
| 266 | return reader.readLine(); |
| 267 | } catch (Throwable e) { |
| 268 | throw closer.rethrow(e); |
| 269 | } finally { |
| 270 | closer.close(); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | /** |
| 275 | * Reads all the lines of this source as a list of strings. The returned list will be empty if |