Refactor the NIO and OIO transport to make use of the proposed API.

* FileRegion writes are not supported yet