nope.. don't use datagram...
Datagram is for multicast/broadcast purpose, meaning, the receiver
is not only one, but a group, and datagram uses UDP, it means there
is no guarantee that the packet you send arrived at destination or
arrived in sequence (if u send a b c d, the receiver may receive a
b d c).
You can use TCP, try to learn ServerSocket and Socket. Yup, you
have to send bytes, so, it is depends on who transfer and who will
receive. Generally, host which has the file become the server and
host which need the file, become the client. So, in server-side, u
use ServerSocket, and in client side, u use Socket...
need more information, go to www.experts-exchange.com, in Java
programming, find me ... my nickname is LexZEUS