Per la lettura dalle porte, puoi usare

http://java.sun.com/products/javacom...api/index.html

o qui per link di uso più generale:
http://java.sun.com/products/javacom...aqs/index.html

Ciao.