MCPcopy Index your code
hub / github.com/antlr/codebuff / writeFrom

Method writeFrom

output/java_guava/1.4.16/CharSink.java:159–173  ·  view source on GitHub ↗

Writes all the text from the given Readable (such as a Reader) to this sink. Does not close readable if it is Closeable. @return the number of characters written @throws IOException if an I/O error occurs in the process of reading from readable or writing

(Readable readable)

Source from the content-addressed store, hash-verified

157 */
158
159 @CanIgnoreReturnValue
160 public long writeFrom(Readable readable) throws IOException {
161 checkNotNull(readable);
162 Closer closer = Closer.create();
163 try {
164 Writer out = closer.register(openStream());
165 long written = CharStreams.copy(readable, out);
166 out.flush(); // https://code.google.com/p/guava-libraries/issues/detail?id=1330
167 return written;
168 } catch (Throwable e) {
169 throw closer.rethrow(e);
170 } finally {
171 closer.close();
172 }
173 }
174}

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected