added sample nio code