pydicom.fileutil.find_delimiter(fp: BinaryIO, delimiter: BaseTag, is_little_endian: bool, read_size: int = 128, rewind: bool = True) int | None[source]

Return file position where 4-byte delimiter is located.

  • delimiter (int) – The delimiter to search for.

  • is_little_endian (bool) – True if little endian, False otherwise.

  • read_size (int) – See find_bytes() for parameter info.

  • rewind (bool) – Flag to rewind to initial position after searching.


Returns None if end of file is reached without finding the delimiter, otherwise the byte offset to the delimiter.

Return type:

int or None