Cross-platform buffer handling