Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
We would like to try following a custom java code using talend.
I stuck in following java code using java components. I am new to the component testing for java code
Also, I would like to make sure below code tested well before to put in a routine section
We tried
below post as well
https://www.talendbyexample.com/talend-tjavaflex-component-reference.html
it did not work for me
Here is Input code
Split file based on size
import java.io.FileInputStream; import java.io.FileOutputStream; class FileSplitter { public static void main(String args[]) throws Exception { FileInputStream fis = new FileInputStream(args[0]); int size = 1024; byte buffer[] = new byte[size]; int count = 0; while (true) { int i = fis.read(buffer, 0, size); if (i == -1) break; String filename = args[1] + count; FileOutputStream fos = new FileOutputStream(filename); fos.write(buffer, 0, i); fos.flush(); fos.close(); ++count; } } }
Any help would be much appreciated
How to test above code in tJava /tJavaFlex before putting into routines. ?