METHOD:

 

 

 

 

 

 

 

DESCRIPTION:

 

 

Copies the binary contents to another stream object.

 

 

 

 

PROPERTY OF:

 

 

ADOStream

 

 

 

 

SYNTAX:

 

 

<oRef>.copyToStream(<stream expO>[,<num expN>])

 

<oRef>

 

 

The stream object to be copied.

 

<stream expO>

 

 

The reference to the another stream object.

 

<num expN>

 

 

The number of characters or bytes to be copied from the current position in the source stream to the destination stream.

 

If omitted, all characters or bytes are copied from the current position to EOS.

 

 

 

DESCRIPTION:

 

 

This method copies the specified number of characters or bytes, starting from the current position specified by the position property. 

 

If the specified number is more than the available number of bytes until EOS, then only characters or bytes from the current position to EOS are copied. 

 

 

 

If there are existing characters or bytes in the destination stream, all contents beyond the point where the copy ends remain, and are not truncated. 

 

Position becomes the byte immediately following the last byte copied. If you want to truncate these bytes, use eos property to set EOS.

 

 

 

This method should be used to copy data to a destination stream of the same type as the source stream.

 

For text stream objects, you can change the charSet property setting of the destination stream to translate from one character set to another. 

 

Also, text stream objects can be successfully copied into binary stream objects, but binary stream objects cannot be copied into text stream objects.