Changed appendBuffer method to accept Base64 strings