public class StandardFlowFileCodec extends Object implements FlowFileCodec
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_FLOWFILE_PATH |
static int |
MAX_NUM_ATTRIBUTES |
private VersionNegotiator |
versionNegotiator |
| Constructor and Description |
|---|
StandardFlowFileCodec() |
| Modifier and Type | Method and Description |
|---|---|
DataPacket |
decode(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 encodedOut)
Encodes a DataPacket and its content as a single stream of data and
writes that stream to the output.
|
String |
getResourceName() |
List<Integer> |
getSupportedVersions()
Returns a List of all versions that this codec is able to support, in the
order that they are preferred by the codec
|
VersionNegotiator |
getVersionNegotiator() |
private String |
readString(DataInputStream in) |
String |
toString() |
private void |
writeString(String val,
DataOutputStream out) |
public static final int MAX_NUM_ATTRIBUTES
public static final String DEFAULT_FLOWFILE_PATH
private final VersionNegotiator versionNegotiator
public void encode(DataPacket dataPacket, OutputStream encodedOut) throws IOException
FlowFileCodecencode in interface FlowFileCodecdataPacket - the data to serializeencodedOut - the stream to write the data toIOException - if there is a communications issuepublic DataPacket decode(InputStream stream) throws IOException, ProtocolException
FlowFileCodecdecode in interface FlowFileCodecstream - an InputStream containing DataPacket's content and
attributesnull if the
stream was out of dataIOException - if unable to read streamProtocolException - if the input is malformedprivate void writeString(String val, DataOutputStream out) throws IOException
IOExceptionprivate String readString(DataInputStream in) throws IOException
IOExceptionpublic List<Integer> getSupportedVersions()
FlowFileCodecgetSupportedVersions in interface FlowFileCodecpublic VersionNegotiator getVersionNegotiator()
getVersionNegotiator in interface VersionedRemoteResourcepublic String getResourceName()
getResourceName in interface VersionedRemoteResourceCopyright © 2023 Apache NiFi Project. All rights reserved.