splitStream method

Stream<List<String>> splitStream({
  1. required List<String> splitters,
  2. List<Object>? delimiters,
  3. bool removeSplitters = true,
  4. bool trimParts = false,
  5. Converter<List<int>, String>? decoder,
})

For parsing large files, stream streams the contents of file and returns the split parts in chunks.

chunkSize represents the number of characters in each chunk, it must not be null and must be > 0.

Implementation

Stream<List<String>> splitStream({
  required List<String> splitters,
  List<Object>? delimiters,
  bool removeSplitters = true,
  bool trimParts = false,
  Converter<List<int>, String>? decoder,
}) {
  assert(splitters.isNotEmpty);
  assert(delimiters == null ||
      delimiters.every(
          (delimiter) => delimiter is String || delimiter is Delimiter));
  return StringSplitterIo.stream(
    this,
    splitters: splitters,
    delimiters: delimiters,
    removeSplitters: removeSplitters,
    trimParts: trimParts,
    decoder: decoder,
  );
}