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)
| 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 |
nothing calls this directly