Package org.apache.nifi.remote.codec
Interface FlowFileCodec
- All Superinterfaces:
VersionedRemoteResource
- All Known Implementing Classes:
StandardFlowFileCodec
Provides a mechanism for encoding and decoding FlowFiles as streams so that they can be transferred remotely.
-
Method Summary
Modifier and TypeMethodDescriptiondecode
(InputStream stream) Decodes the contents of the InputStream, interpreting the data to determine the next DataPacket's attributes and content.void
encode
(DataPacket dataPacket, OutputStream outStream) Encodes a DataPacket and its content as a single stream of data and writes that stream to the output.Returns a List of all versions that this codec is able to support, in the order that they are preferred by the codecMethods inherited from interface org.apache.nifi.remote.VersionedRemoteResource
getResourceName, getVersionNegotiator
-
Method Details
-
getSupportedVersions
Returns a List of all versions that this codec is able to support, in the order that they are preferred by the codec- Returns:
- all supported versions
-
encode
void encode(DataPacket dataPacket, OutputStream outStream) throws IOException, TransmissionDisabledException Encodes a DataPacket and its content as a single stream of data and writes that stream to the output.- Parameters:
dataPacket
- the data to serializeoutStream
- the stream to write the data to- Throws:
IOException
- if there is a communications issueTransmissionDisabledException
- if a user terminates the connection
-
decode
DataPacket decode(InputStream stream) throws IOException, ProtocolException, TransmissionDisabledException Decodes the contents of the InputStream, interpreting the data to determine the next DataPacket's attributes and content.- Parameters:
stream
- an InputStream containing DataPacket's content and attributes- Returns:
- the DataPacket that was created, or
null
if the stream was out of data - Throws:
IOException
- if unable to read streamProtocolException
- if the input is malformedTransmissionDisabledException
- if a user terminates the connection
-