@Beta public final class Funnels extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.io.OutputStream |
asOutputStream(PrimitiveSink sink)
Wraps a
PrimitiveSink as an OutputStream , so it is easy to
funnel an object to a PrimitiveSink
if there is already a way to write the contents of the object to an OutputStream . |
static Funnel<byte[]> |
byteArrayFunnel()
Returns a funnel that extracts the bytes from a
byte array. |
static Funnel<java.lang.Integer> |
integerFunnel()
Returns a funnel for integers.
|
static Funnel<java.lang.Long> |
longFunnel()
Returns a funnel for longs.
|
static Funnel<java.lang.CharSequence> |
stringFunnel()
Returns a funnel that extracts the characters from a
CharSequence . |
public static Funnel<byte[]> byteArrayFunnel()
byte
array.public static Funnel<java.lang.CharSequence> stringFunnel()
CharSequence
.public static Funnel<java.lang.Integer> integerFunnel()
public static Funnel<java.lang.Long> longFunnel()
public static java.io.OutputStream asOutputStream(PrimitiveSink sink)
PrimitiveSink
as an OutputStream
, so it is easy to
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 OutputStream
do nothing, and no method throws IOException
.