Optimized magic bytes writes to channel