Added buffer manager for encoding and decoding messages