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

Method copyTo

output/java_guava/1.4.19/CharSource.java:195–207  ·  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

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.

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