refactor nio write

refactor nio write  inspire from netty.Note that this is a conceptual demo,maybe can't run