refactored write methods to support byte-level transport