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

Method writeFrom

android/guava/src/com/google/common/io/ByteSink.java:113–120  ·  view source on GitHub ↗

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

(InputStream input)

Source from the content-addressed store, hash-verified

111 * @throws IOException if an I/O occurs while reading from {@code input} or writing to this sink
112 */
113 @CanIgnoreReturnValue
114 public long writeFrom(InputStream input) throws IOException {
115 checkNotNull(input);
116
117 try (OutputStream out = openStream()) {
118 return ByteStreams.copy(input, out);
119 }
120 }
121
122 /**
123 * A char sink that encodes written characters with a charset and writes resulting bytes to this

Callers

nothing calls this directly

Calls 3

openStreamMethod · 0.95
copyMethod · 0.95
checkNotNullMethod · 0.45