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

Method asOutputStream

android/guava/src/com/google/common/hash/Funnels.java:246–248  ·  view source on GitHub ↗

Wraps a {@code PrimitiveSink} as an {@link OutputStream}, so it is easy to {@link Funnel#funnel funnel} an object to a {@code PrimitiveSink} if there is already a way to write the contents of the object to an {@code OutputStream}. <p>The {@code close} and {@code flush} methods of the returned {@cod

(PrimitiveSink sink)

Source from the content-addressed store, hash-verified

244 * @since 13.0
245 */
246 public static OutputStream asOutputStream(PrimitiveSink sink) {
247 return new SinkAsStream(sink);
248 }
249
250 private static final class SinkAsStream extends OutputStream {
251 final PrimitiveSink sink;

Callers 2

hashMethod · 0.95
testAsOutputStreamMethod · 0.95

Calls

no outgoing calls

Tested by 1

testAsOutputStreamMethod · 0.76