   /// - bufferCapacity: capacity of the internal data buffer
   /// - readFunc: called to read the input data
   ///
-  /// - Throws: `FilterError.state` if filter initialization failed
+  /// - Throws: `FilterError.invalidState` if filter initialization failed
   public init(
     _ operation: FilterOperation,
     using algorithm: Algorithm,

      }

      // Sanity checks
      if _remaining != 0 && _regionRemaining == 0 { throw FilterError.state }
    }
  }


  /// - Parameter data: data to process
  ///
  /// - Throws:
  /// `FilterError.invalidData` if an error occurs during processing,
  /// or if `data` is not empty/nil, and the filter is the finalized state
  public func write<D : DataProtocol>(_ data: D?) throws {
    // Finalize if data is empty/nil
    if data == nil || data!.isEmpty { try finalize() ; return }

    // Fail if already finalized
    if _finalized { throw FilterError.invalidData }

    // Process all incoming data
    for region in data!.regions {
