def _parse_tile_part_bit_stream(self, fptr, sod_marker, tile_length):
read_buffer = fptr.read(tile_length)<EOL>count = min(tile_length, len(read_buffer))<EOL>packet = np.frombuffer(read_buffer, dtype=np.uint8, count=count)<EOL>indices = np.where(packet == <NUM_LIT>)<EOL>for idx in indices[<NUM_LIT:0>]:<EOL><INDENT>try:<EOL><INDENT>if packet[idx + <NUM_LIT:1>] == <NUM_LIT> and (idx < (len(packet) - <NUM_LIT:5>)):<EOL><INDENT>offset = sod_marker.offset + <NUM_LIT:2> + idx<EOL>length = <NUM_LIT:4><EOL>nsop = packet[(idx + <NUM_LIT:4>):(idx + <NUM_LIT:6>)].view('<STR_LIT>')[<NUM_LIT:0>]<EOL>if sys.byteorder == '<STR_LIT>':<EOL><INDENT>nsop = nsop.byteswap()<EOL><DEDENT>segment = SOPsegment(nsop, length, offset)<EOL>self.segment.append(segment)<EOL><DEDENT>elif packet[idx + <NUM_LIT:1>] == <NUM_LIT>:<EOL><INDENT>offset = sod_marker.offset + <NUM_LIT:2> + idx<EOL>length = <NUM_LIT:0><EOL>segment = EPHsegment(length, offset)<EOL>self.segment.append(segment)<EOL><DEDENT><DEDENT>except IndexError:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>
Parse the tile part bit stream for SOP, EPH marker segments.