changed to Java NIO . First test passed