Read and write using protocol buffers