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

Method writeFrom

output/java_guava/1.4.17/ByteSink.java:130–144  ·  view source on GitHub ↗

Writes all the bytes from the given InputStream to this sink. Does not close input. @return the number of bytes written @throws IOException if an I/O occurs in the process of reading from input or writing to this sink

(InputStream input)

Source from the content-addressed store, hash-verified

128 */
129
130 @CanIgnoreReturnValue
131 public long writeFrom(InputStream input) throws IOException {
132 checkNotNull(input);
133 Closer closer = Closer.create();
134 try {
135 OutputStream out = closer.register(openStream());
136 long written = ByteStreams.copy(input, out);
137 out.flush(); // https://code.google.com/p/guava-libraries/issues/detail?id=1330
138 return written;
139 } catch (Throwable e) {
140 throw closer.rethrow(e);
141 } finally {
142 closer.close();
143 }
144 }
145
146 /**
147 * A char sink that encodes written characters with a charset and writes resulting bytes to this

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