System.IOUtils.TFile.ReadAllBytes

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function ReadAllBytes(const Path: string): TBytes; static;

C++

static System::DynamicArray<System::Byte> __fastcall ReadAllBytes(const System::UnicodeString Path);

Properties

Type Visibility Source Unit Parent
function public
System.IOUtils.pas
System.IOUtils.hpp
System.IOUtils TFile

Description

Reads the contents of the file into a byte array.

Use ReadAllBytes to read the contents of a binary file. ReadAllBytes returns a new byte array containing the file data. The following table lists the parameters expected by this method.



Name Meaning

Path

The path to the file.



Note: ReadAllBytes raises an exception if the file cannot be opened or the path is invalid.

See Also