bytes sending, file writing