def _try_to_ensure_num_bytes_in_buffer(self, file_to_read, read_buffer, num_bytes):
    while (len(read_buffer.data) < num_bytes):
        read_data = file_to_read.read(self._buffer_size)
        if (not read_data):
            return False
        read_buffer.data += read_data
    return True
def _try_to_ensure_num_bytes_in_buffer(self, file_to_read, read_buffer, num_bytes):
    while (len(read_buffer.data) < num_bytes):
        read_data = file_to_read.read(self._buffer_size)
        if (not read_data):
            return False
        read_buffer.data += read_data
    return True