Code reformat and optimization
[Java] NIO client