code: def _parse_tile_part_bit_stream(self, fptr, sod_marker, tile_length):
          
          read_buffer = fptr.read(tile_length)
          # The tile length could possibly be too large and extend past
          # the end of file.  We need to be a bit resilient.
          count = min(tile_length, len(read_buffer))
          packet = np.frombuffer(read_buffer, dtype=np.uint8, count=count)
  
          indices = np.where(packet == 0xff)
          for idx in indices[0]:
              try:
                  if packet[idx + 1] == 0x91 and (idx < (len(packet) - 5)):
                      offset = sod_marker.offset + 2 + idx
                      length = 4
                      nsop = packet[(idx + 4):(idx + 6)].view('uint16')[0]
                      if sys.byteorder == 'little':
                          nsop = nsop.byteswap()
                      segment = SOPsegment(nsop, length, offset)
                      self.segment.append(segment)
                  elif packet[idx + 1] == 0x92:
                      offset = sod_marker.offset + 2 + idx
                      length = 0
                      segment = EPHsegment(length, offset)
                      self.segment.append(segment)
              except IndexError:
                  continue
docs: Parse the tile part bit stream for SOP, EPH marker segments.