Appends the contents of this source to the given {@link Appendable} (such as a {@link Writer}). Does not close {@code appendable} if it is {@code Closeable}. @return the number of characters copied @throws IOException if an I/O error occurs while reading from this source or writing to {@code ap
(Appendable appendable)
| 245 | * appendable} |
| 246 | */ |
| 247 | @CanIgnoreReturnValue |
| 248 | public long copyTo(Appendable appendable) throws IOException { |
| 249 | checkNotNull(appendable); |
| 250 | |
| 251 | Closer closer = Closer.create(); |
| 252 | try { |
| 253 | Reader reader = closer.register(openStream()); |
| 254 | return CharStreams.copy(reader, appendable); |
| 255 | } catch (Throwable e) { |
| 256 | throw closer.rethrow(e); |
| 257 | } finally { |
| 258 | closer.close(); |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | /** |
| 263 | * Copies the contents of this source to the given sink. |
nothing calls this directly
no test coverage detected