buffer implementation for WRITE case: compiled successfully