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

Method copyTo

guava/src/com/google/common/io/CharSource.java:247–260  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 7

createMethod · 0.95
registerMethod · 0.95
openStreamMethod · 0.95
copyMethod · 0.95
rethrowMethod · 0.95
closeMethod · 0.95
checkNotNullMethod · 0.45

Tested by

no test coverage detected