Wraps a PrimitiveSink as an OutputStream, so it is easy to Funnel#funnel funnel an object to a PrimitiveSink if there is already a way to write the contents of the object to an OutputStream. The close and flush methods of the returned {@cod
(PrimitiveSink sink)
| 234 | * @since 13.0 |
| 235 | */ |
| 236 | public static OutputStream asOutputStream(PrimitiveSink sink) { |
| 237 | return new SinkAsStream(sink); |
| 238 | } |
| 239 | |
| 240 | private static class SinkAsStream extends OutputStream { |
| 241 | final PrimitiveSink sink; |