change a nio API from jdk1.7 to jdk1.6