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)
| 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; |
no outgoing calls