private Boolean closed = false; // true when we are closed /// <summary> /// This opens a large object. /// If the object does not exist, then an NpgsqlException is thrown. /// </summary> /// <param name="fp">FastPath API for the connection to use.</param> /// <param name="oid">OID of the Large Object to open.</param> /// <param name="mode">Mode of opening the large object</param> public LargeObject(Fastpath fp, Int32 oid, Int32 mode) { this.fp = fp; this.oid = oid; FastpathArg[] args = new FastpathArg[2]; args[0] = new FastpathArg(oid); args[1] = new FastpathArg(mode); this.fd = fp.GetInteger("lo_open", args); }
/// <summary> /// This creates a large object, returning its OID. /// </summary> /// <returns>OID of new object.</returns> public Int32 Create() { FastpathArg[] args = new FastpathArg[1]; args[0] = new FastpathArg(READWRITE); return(fp.GetInteger("lo_creat", args)); }
/// <summary> /// Report the current position within the object. /// </summary> /// <returns>The current position within the object.</returns> public Int32 Tell() { FastpathArg[] args = new FastpathArg[1]; args[0] = new FastpathArg(fd); return(fp.GetInteger("lo_tell", args)); }