MCPcopy Create free account
hub / github.com/antlr/codebuff / copyTo

Method copyTo

corpus/java/training/guava/io/CharSource.java:188–201  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

186 * writing to {@code appendable}
187 */
188 @CanIgnoreReturnValue
189 public long copyTo(Appendable appendable) throws IOException {
190 checkNotNull(appendable);
191
192 Closer closer = Closer.create();
193 try {
194 Reader reader = closer.register(openStream());
195 return CharStreams.copy(reader, appendable);
196 } catch (Throwable e) {
197 throw closer.rethrow(e);
198 } finally {
199 closer.close();
200 }
201 }
202
203 /**
204 * 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