Creating a user routine - 8.0

Data Integration Job Examples

Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Talend Studio
Design and Development > Designing Jobs
Last publication date


  1. In the Repository tree view, expand Code to display the Routines folder.
  2. Right-click Routines and select Create routine.
  3. The New routine dialog box opens. Enter its name, in this example MyRoutineDemo, a purpose and a description.
  4. Click Finish to close the dialog box.
    Note: The newly created routine appears in the Repository tree view, directly below the Routines node.

    The routine editor opens to reveal a model routine which contains a simple example, by default, comprising descriptive text in blue, followed by the corresponding code.

  5. Replace the model with the following code and press Ctrl+S to save the routine.

    It has a ByteArrayFromFile function, that requires a file path as input parameter and is used to read a file and convert it to a byte array.

    package routines;public class MyRoutineDemo {
    public static byte[] ByteArrayFromFile(String filepath) {
    try{ file=new; fis = new;
    int fileLength = (int) file.length();
    byte[] incoming_file_data = new byte[fileLength]; // allocate byte array of right size, 0, fileLength ); // read into byte array
    return incoming_file_data;
    }catch(Exception err){
    err.printStackTrace();return null;