Storages & Files ReadBin
ReadBin method

Reads from the stream the number of bytes specified.


variable = object.ReadBin(bytes)


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


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


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 [ ]