Appends the contents of this source to the given Appendable (such as a Writer). Does not close appendable if it is Closeable. @return the number of characters copied @throws IOException if an I/O error occurs in the process of reading from this source or writing
(Appendable appendable)
| 193 | */ |
| 194 | |
| 195 | @CanIgnoreReturnValue |
| 196 | public long copyTo(Appendable appendable) throws IOException { |
| 197 | checkNotNull(appendable); |
| 198 | Closer closer = Closer.create(); |
| 199 | try { |
| 200 | Reader reader = closer.register(openStream()); |
| 201 | return CharStreams.copy(reader, appendable); |
| 202 | } catch (Throwable e) { |
| 203 | throw closer.rethrow(e); |
| 204 | } finally { |
| 205 | closer.close(); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | /** |
| 210 | * Copies the contents of this source to the given sink. |
nothing calls this directly
no test coverage detected