this is a scala nio sample