Storages & Files ReadBin
ReadBin method

Reads from the stream the number of bytes specified.

Syntax:

variable = object.ReadBin(bytes)

Parameters:

bytes - integer number specifying the number of bytes to read.

Examples:

Dim sf,strm,bin
Set sf = Server.CreateObject("newObjects.utilctls.SFMain")
Set strm = sf.OpenFile("c:\myfile.bin")
bin = strm.ReadBin(100)
' Reads 100 bytes from the stream

Remarks:

The bytes read are packed in a VARIANT vontaiing binary array (VT_ARRAY | VT_UI1). The result can be passed to any property or method expecting binary data. You can pass the result directly to WriteBin method or for example to the Response.BinaryWrite method in ASP/ALP.

If the end of stream is reached during the read operation the number of the bytes returned will be less than the number of bytes requested.

Applies to: SFStream object

See also: WriteBin, Response.BinaryWrite

newObjects Copyright 2001-2006 newObjects [ ]