code: function (value, returnType, encoding) {
      var returnValue = value
      if (returnType === 'bin') {
        if (!Buffer.isBuffer(value)) {
          throw new TypeError('Value is not a buffer')
        }
      } else {
        returnValue = MessageUtils.decode(value, encoding)
        if (returnType === 'obj') {
          returnValue = MessageUtils.jsonToObject(returnValue)
        }
      }
      return returnValue
    }
docs: Convert the supplied value to the supplied returnType. If the returnType is
  'bin', the value is returned as a binary buffer. If the returnType is
  'obj', the value is returned as an object, deserialized from a JSON string.
  If the returnType is 'txt' (or anything else), the value is returned as a
  string.
  @param {(Buffer|String)} value - The value.
  @param {String} returnType - One of 'bin', 'obj', or 'txt'.
  @param {String} [encoding=utf8] - The encoding of the value. (Unused
  when returnType is 'bin'.)
  @returns {(Buffer|Object|String)} The value converted from the buffer.
  @throws {TypeError} If 'bin' is requested but the value is not a binary
  buffer.