T
- type of the object to (de)serialize.public final class SparkCoder<T> extends Object implements Coder<T>
Coder.DummyCoder
DUMMY_CODER
Constructor and Description |
---|
SparkCoder(org.apache.spark.serializer.Serializer serializer)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
T |
decode(InputStream inStream)
Decodes the a value from the given input stream.
|
void |
encode(T element,
OutputStream outStream)
Encodes the given value onto the specified output stream.
|
public SparkCoder(org.apache.spark.serializer.Serializer serializer)
serializer
- kryo serializer.public void encode(T element, OutputStream outStream) throws IOException
Coder
encode
in interface Coder<T>
element
- the element to be encodedoutStream
- the stream on which encoded bytes are writtenIOException
- if fail to encodepublic T decode(InputStream inStream) throws IOException
Coder
decode
in interface Coder<T>
inStream
- the stream from which bytes are readIOException
- if fail to decodeCopyright © 2018. All rights reserved.