Send script to 30001 from urcap java

As, I want to send script to 30001 port if i given it by storing in file and then reading from file as a string and change it to byte array and then sending to port It was not working and I tried send directly strings to port it works but movement is not smooth.

I was sending by reading line by line from file.