[Overview][Resource strings][Constants][Types][Classes][Index] | Reference for unit 'resource' (#fcl-res)

# TResources.FindReader

Searches for a suitable resource reader

## Declaration

Source position: resource.pp line 261

`public class function TResources.FindReader(`
`aStream: TStream;`
`aExtension: string`
`):TAbstractResourceReader; class function TResources.FindReader(`
`aStream: TStream`
`):TAbstractResourceReader;`

## Arguments

`aStream` |  | The stream to be probed
`aExtension` |  | The extension the reader is registered for

## Function result

An instance of a TAbstractResourceReader descendant.

## Arguments

`aStream` |  | The stream to be probed

## Description

This method tries to find a resource reader able to read the stream passed as parameter.

If an extension is specified, only readers matching that extension are tried. The extension is case-insensitive and includes the leading dot, unless the empty string is passed (which means "no extension", e.g. a unix executable, which doesn't have an extension).

If a suitable reader is found, an instance of that reader is returned.

Remark: | To make a resource reader class known, add that resource reader unit to the uses clause of your program.

## Errors

If no suitable reader is found, an EResourceReaderNotFoundException exception is raised.

## See also

TAbstractResourceReader |  | Base abstract resource reader class