Using DFS Client Java APIs, you can perform file read/write operations on HDFS. It uses the ClientProtocol to communicate with a NameNode daemon and connects directly to DataNodes to read/write block data.
This link will take you to Apache Hadoop site where you can access documentation for latest version of DFS Client APIs.