code: def seek(self, offset, whence=SEEK_SET):
          
          # A nice trick is to (ab)use BytesIO.seek() to go to the desired position for easier calculation.
          # This will not add any data to the buffer however - very convenient!
          self.data.seek(offset, whence)
          new_pos = self.data.tell()
          missing_bytes_to_read = new_pos - self._current_lob_length
          if missing_bytes_to_read > 0:
              # Trying to seek beyond currently available LOB data, so need to load some more first.
  
              # We are smart here: (at least trying...):
              #         If a user sets a certain file position s/he probably wants to read data from
              #         there. So already read some extra data to avoid yet another immediate
              #         reading step. Try with EXTRA_NUM_ITEMS_TO_READ_AFTER_SEEK additional items (bytes/chars).
  
              # jump to the end of the current buffer and read the new data:
              self.data.seek(0, SEEK_END)
              self.read(missing_bytes_to_read + self.EXTRA_NUM_ITEMS_TO_READ_AFTER_SEEK)
              # reposition file pointer a originally desired position:
              self.data.seek(new_pos)
          return new_pos
docs: Seek pointer in lob data buffer to requested position.
          Might trigger further loading of data from the database if the pointer is beyond currently read data.