def read_binary(self, key, b64decode=True, decode=False):
        """Read method of CRUD operation for binary data.

        Args:
            key (string): The variable to read from the DB.
            b64decode (bool): If true the data will be base64 decoded.
            decode (bool): If true the data will be decoded to a String.

        Returns:
            (bytes|string): Results retrieved from DB.
        """
        data = None
        if key is not None:
            data = self.db.read(key.strip())
            if data is not None:
                data = json.loads(data)
                if b64decode:
                    # if requested decode the base64 string
                    data = base64.b64decode(data)
                    if decode:
                        try:
                            # if requested decode bytes to a string
                            data = data.decode('utf-8')
                        except UnicodeDecodeError:
                            # for data written an upstream java App
                            data = data.decode('latin-1')
        else:
            self.tcex.log.warning(u'The key field was None.')
        return data
Read method of CRUD operation for binary data.

        Args:
            key (string): The variable to read from the DB.
            b64decode (bool): If true the data will be base64 decoded.
            decode (bool): If true the data will be decoded to a String.

        Returns:
            (bytes|string): Results retrieved from DB.