Add write() to specify parameters directly
Move AttachedMessage to the nio package