[Overview][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'process' (#fcl)

# TPROCESS.ReadInputStream

Read available data from input stream

## Declaration

Source position: processbody.inc line 122

`public function TPROCESS.ReadInputStream(`
`p: TInputPipeStream;`
`var BytesRead: Integer;`
`var DataLength: Integer;`
`var Data: string;`
`MaxLoops: Integer = 10`
`):Boolean; virtual; function TPROCESS.ReadInputStream(`
`p: TInputPipeStream;`
`data: TStream;`
`MaxLoops: Integer = 10`
`):Boolean; virtual;`

## Arguments

`p` |  | Pipe stream to read data from
`BytesRead` |  | Number of bytes read during the call
`DataLength` |  | On entry, length of data. Updated with new length when the call ends
`Data` |  | String data or stream data
`MaxLoops` |  | Number of times to check if data is available

## Function result

True if data was read

## Arguments

`p` |  | Pipe stream to read data from
`data` |  | String data or stream data
`MaxLoops` |  | Number of times to check if data is available

## Description

ReadInputStream reads data from the given input pipe stream p after checking that data is available. It returns True if data was succesfully read from the file handle. In the variant with a string data, the data is placed in the string Data, and DataLength is updated with the new length, BytesRead is updated with the amount of bytes read. MaxLoop determines how often an attempt at reading data is made.

In the variant with a stream, the available data is simply written to the stream.

## Errors

None.