Reads binary data from a file and associates the data with a CORBA object. This function can be used to set parameters of a request in advance of calling the IiopRequest function.
IIOP.bdh
IiopSetBinaryFromFile(in hIiop : number, in sFile : string, in nBytes : number optional, in nAlign : number optional): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
hIiop | Handle to a CORBA object |
sFile | Name of the file containing the binary data. If NULL, the filename passed to the previous IiopSetBinaryFromFile function call (belonging to the same request) is used |
nBytes | Number of bytes to read from the file. If omitted or zero, the whole file is read. |
nAlign |
Binary data alignment (optional). Possible options are:
Default setting is alignment to 1-byte boundaries. |
// send a large graphic file to a printer object dcltrans transaction TSetBinaryFromFile const FRAGMENTSIZE := 4096; FILENAME := "IMAGE.GIF"; var hIiop, nFragments, nFilesize, i: number; begin // retrieve handle to CORBA object, filesize and // number of fragments ... // send fragmented messageIiopSetBinaryFromFile(hIiop, FILENAME, nFilesize MOD FRAGMENTSIZE); for i := 1 to nFragments do // indicate begin of new fragment IiopSetFragment(hIiop); // send next fragment IiopSetBinaryFromFile(hIiop, NULL, FRAGMENTSIZE); end; IiopRequest(hIiop, "print", IIOP_USE_V11); end TSetBinaryFromFile;