copyTo method

void copyTo(
  1. IStream? pstm,
  2. int cb,
  3. Pointer<Uint64>? pcbRead,
  4. Pointer<Uint64>? pcbWritten,
)

Copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/objidl/nf-objidl-istream-copyto.

Implementation

@pragma('vm:prefer-inline')
void copyTo(
  IStream? pstm,
  int cb,
  Pointer<Uint64>? pcbRead,
  Pointer<Uint64>? pcbWritten,
) {
  final hr$ = HRESULT(
    _CopyToFn(
      ptr,
      pstm?.ptr ?? nullptr,
      cb,
      pcbRead ?? nullptr,
      pcbWritten ?? nullptr,
    ),
  );
  if (hr$.isError) throw WindowsException(hr$);
}