TStreamFileReader() > Methods xHarbour Developers Network  

oTStreamFileReader:read()

Reads data from the stream into memory.

Syntax

:read( @<cBuffer>, [<nOffset>], <nBytes> ) --> nBytesRead

Arguments

@<cBuffer>
A memory variable holding a character string must be passed by reference. It must have at least <nBytes> characters.
<nBytes>
This is a numeric value specifying the number of bytes to transfer from the data stream into the memory variable <cBuffer>, beginning at the current file pointer position.
<nOffset>
This is a numeric value specifying the number of bytes to skip at the beginning of <cBuffer> where the result is copied to. This allows to copy the data from the file into the middle of a string buffer. The default value is zero. Note that the sum of <nBytes>+<nOffset> must be smaller than or equal Len(<cBuffer>).

Description

Method :read() reads <nBytes> bytes from the current position ::nPosition in the data stream and copies them to the memory variable <cBuffer>, beginning at the position <nOffset>. The file pointer is advanced by <nBytes> bytes until the end-of-file is reached. The return value is numeric indicating the number of bytes read from the stream.

Refer to function FRead() for more information on low-level file reading.


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe