javax.comm API use Java stream style when write to and read from serialport. Off course, you can get input stream of file to be sent, then writeit to output stream of serial port connection.