class MalformedChunkHandler {

    public void handle(FlowFile original, ProcessSession processSession, String chunkName, byte[] badChunk) {
        FlowFile flowFile = processSession.create(original);
        flowFile = processSession.putAttribute(flowFile, CoreAttributes.FILENAME.key(), chunkName);
        flowFile = processSession.putAttribute(flowFile, CoreAttributes.MIME_TYPE.key(), MediaType.APPLICATION_BINARY.toString());
        flowFile = processSession.write(flowFile, out -> out.write(badChunk));
        processSession.transfer(flowFile, badChunkRelationship);
    }

    public  MalformedChunkHandler(Relationship badChunkRelationship);

}