renamed fixedHeader.buf to fixedHeader.inbuf
renamed fixedHeader.resetBuf to fixedHeader.resetInbuf
added outbuf to handle encoding, added test cases for decode->encode->decode