Walter.IO
ReadBinary Method
Walter.IO Assembly > Walter.IO Namespace > FileInfoExtensions Class : ReadBinary Method
The file to be read.
Reads the content of a file and returns it as a byte array.
Syntax
public static byte[] ReadBinary( 
   FileInfo file
)

Parameters

file
The file to be read.

Return Value

A byte array containing the contents of the file.
Exceptions
ExceptionDescription
Thrown when the file argument is null.
Thrown when the file specified by file does not exist.
Remarks
Useful for processing file content directly in memory, such as for analyzing file data or interfacing with services requiring byte input. Particularly used for sending file contents to an AI model for malware detection.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

FileInfoExtensions Class
FileInfoExtensions Members