Move send/write implementations into parts
No more ByteArrayInputStream
minor clean up