def METHOD_NAME(self, local_index: int, sample: InputSample):
    self.prepare_for_write()
    serialized_sample, shape = self.serialize_sample(
        sample, self.compression, break_into_tiles=False
    )
    self.check_shape_for_update(shape)
    old_data = self.data_bytes
    self.data_bytes = self.create_updated_data(
        local_index, old_data, serialized_sample
    )
    # update encoders and meta
    new_nb = (
        None if self.byte_positions_encoder.is_empty() else len(serialized_sample)
    )
    self.update_in_meta_and_headers(local_index, new_nb, shape)