Package spark.serialization
Class Serializer
java.lang.Object
spark.serialization.Serializer
- Direct Known Subclasses:
BytesSerializer
,DefaultSerializer
,InputStreamSerializer
Class that serializers and writes the result to given output stream.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
canProcess
(Object element) Checks if the serializer implementation can process the element type.abstract void
process
(OutputStream outputStream, Object element) Processes the provided element and serializes to output stream.void
processElement
(OutputStream outputStream, Object element) Wrapsprocess(java.io.OutputStream, Object)
and calls next serializer in chain.void
setNext
(Serializer serializer) Sets the next serializer in the chain.
-
Field Details
-
next
-
-
Constructor Details
-
Serializer
public Serializer()
-
-
Method Details
-
setNext
Sets the next serializer in the chain.- Parameters:
serializer
- the next serializer.
-
processElement
Wrapsprocess(java.io.OutputStream, Object)
and calls next serializer in chain.- Parameters:
outputStream
- the output stream.element
- the element to process.- Throws:
IOException
- IOException in case of IO error.
-
canProcess
Checks if the serializer implementation can process the element type.- Parameters:
element
- the element to process.- Returns:
- true if the serializer can process the provided element.
-
process
Processes the provided element and serializes to output stream.- Parameters:
outputStream
- the output stream.element
- the element.- Throws:
IOException
- In the case of IO error.
-