(self, additional_bits: int)
Overwrite first three bits in the file
        :param additional_bits: number of bits that were appended to fill last byte
        :return:
Overwrite first three bits in the file
        :param additional_bits: number of bits that were appended to fill last byte
        :return:
Overwrite first three bits in the file : param additional_bits : number of bits that were appended to fill last byte : return :
def _save_information_about_additional_bits(self, additional_bits: int):
        """
        Overwrite first three bits in the file
        :param additional_bits: number of bits that were appended to fill last byte
        :return:
        """
        self.file.seek(0)
        first_byte_raw = self.file.read(1)
        self.file.seek(0)
        first_byte = "{0:08b}".format(int.from_bytes(first_byte_raw, "big"))
        # overwrite first three bits
        first_byte = first_byte[3:]
        first_byte = "{0:03b}".format(additional_bits) + first_byte

        self.write_bits(first_byte)
def _save_information_about_additional_bits ( self , additional_bits : int ) : self . file . seek ( 0 ) first_byte_raw = self . file . read ( 1 ) self . file . seek ( 0 ) first_byte = "{0:08b}" . format ( int . from_bytes ( first_byte_raw , "big" ) ) # overwrite first three bits first_byte = first_byte [ 3 : ] first_byte = "{0:03b}" . format ( additional_bits ) + first_byte self . write_bits ( first_byte )