GetData() public méthode

This convenience method assumes that the return value is an Integer.
public GetData ( String name, NpgsqlTypes.FastpathArg args ) : Byte[]
name String Function name.
args NpgsqlTypes.FastpathArg Function arguments.
Résultat Byte[]
Exemple #1
0
        /// <summary>
        /// Reads some data from the object, and return as a byte[] array.
        /// </summary>
        /// <param name="len">Number of bytes to read.</param>
        /// <returns>Array containing data read.</returns>
        public Byte[] Read(Int32 len)
        {
            // This is the original method, where the entire block (len bytes)
            // is retrieved in one go.
            FastpathArg[] args = new FastpathArg[2];
            args[0] = new FastpathArg(fd);
            args[1] = new FastpathArg(len);
            return(fp.GetData("loread", args));

            // This version allows us to break this down Int32o 4k blocks
            //if (len<=4048) {
            //// handle as before, return the whole block in one go
            //FastpathArg args[] = new FastpathArg[2];
            //args[0] = new FastpathArg(fd);
            //args[1] = new FastpathArg(len);
            //return fp.getData("loread",args);
            //} else {
            //// return in 4k blocks
            //byte[] buf=new byte[len];
            //int off=0;
            //while (len>0) {
            //int bs=4048;
            //len-=bs;
            //if (len<0) {
            //bs+=len;
            //len=0;
            //}
            //read(buf,off,bs);
            //off+=bs;
            //}
            //return buf;
            //}
        }
Exemple #2
0
        /*
         * Reads some data from the object, and return as a byte[] array
         *
         * @param len number of bytes to read
         * @return byte[] array containing data read
         * @exception NpgsqlException if a database-access error occurs.
         */

        public Byte[] Read(Int32 len)
        {
            // This is the original method, where the entire block (len bytes)
            // is retrieved in one go.
            FastpathArg[] args = new FastpathArg[2];
            args[0] = new FastpathArg(fd);
            args[1] = new FastpathArg(len);
            return(fp.GetData("loread", args));
        }