Class ByteArraySchema
- java.lang.Object
-
- org.apache.flink.api.common.serialization.ByteArraySchema
-
- All Implemented Interfaces:
Serializable,DeserializationSchema<byte[]>,SerializationSchema<byte[]>,ResultTypeQueryable<byte[]>
@PublicEvolving public class ByteArraySchema extends Object implements DeserializationSchema<byte[]>, SerializationSchema<byte[]>
Simple serialization schema for bytes.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.api.common.serialization.DeserializationSchema
DeserializationSchema.InitializationContext
-
Nested classes/interfaces inherited from interface org.apache.flink.api.common.serialization.SerializationSchema
SerializationSchema.InitializationContext
-
-
Constructor Summary
Constructors Constructor Description ByteArraySchema()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]deserialize(byte[] message)Deserializes the byte message.TypeInformation<byte[]>getProducedType()Gets the data type (as aTypeInformation) produced by this function or input format.booleanisEndOfStream(byte[] nextElement)Method to decide whether the element signals the end of the stream.byte[]serialize(byte[] element)Serializes the incoming element to a specified type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.api.common.serialization.DeserializationSchema
deserialize, open
-
Methods inherited from interface org.apache.flink.api.common.serialization.SerializationSchema
open
-
-
-
-
Method Detail
-
deserialize
public byte[] deserialize(byte[] message) throws IOExceptionDescription copied from interface:DeserializationSchemaDeserializes the byte message.- Specified by:
deserializein interfaceDeserializationSchema<byte[]>- Parameters:
message- The message, as a byte array.- Returns:
- The deserialized message as an object (null if the message cannot be deserialized).
- Throws:
IOException
-
isEndOfStream
public boolean isEndOfStream(byte[] nextElement)
Description copied from interface:DeserializationSchemaMethod to decide whether the element signals the end of the stream. If true is returned the element won't be emitted.- Specified by:
isEndOfStreamin interfaceDeserializationSchema<byte[]>- Parameters:
nextElement- The element to test for the end-of-stream signal.- Returns:
- True, if the element signals end of stream, false otherwise.
-
serialize
public byte[] serialize(byte[] element)
Description copied from interface:SerializationSchemaSerializes the incoming element to a specified type.- Specified by:
serializein interfaceSerializationSchema<byte[]>- Parameters:
element- The incoming element to be serialized- Returns:
- The serialized element.
-
getProducedType
public TypeInformation<byte[]> getProducedType()
Description copied from interface:ResultTypeQueryableGets the data type (as aTypeInformation) produced by this function or input format.- Specified by:
getProducedTypein interfaceResultTypeQueryable<byte[]>- Returns:
- The data type produced by this function or input format.
-
-