System.IOUtils.TFile.WriteAllBytes
Delphi
class procedure WriteAllBytes(const Path: string; const Bytes: TBytes); static;
C++
static void __fastcall WriteAllBytes(const System::UnicodeString Path, const System::Sysutils::TBytes Bytes);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.IOUtils.pas System.IOUtils.hpp |
System.IOUtils | TFile |
Description
Writes a byte array to a file.
Use WriteAllBytes to write a given array of bytes to a file. If the file specified by the Path parameter exists, it is overwritten; otherwise the file is created and filled with the given bytes. The following table lists the parameters expected by this method.
Name | Meaning |
---|---|
Path |
The path to the file. |
Bytes |
The array of bytes to be written. |
Note: WriteAllBytes raises an exception if the file cannot be accessed or the path is invalid.