Platforms to show: All Mac Windows Linux Cross-Platform
Back to MongoGridFSFileMBS class.
MongoGridFSFileMBS.Constructor Private
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | MongoDB | MBS MongoDB Plugin | 25.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
MongoGridFSFileMBS.NewStream as MongoStreamMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | MongoDB | MBS MongoDB Plugin | 25.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
GridFS files are created with CreateFile() or CreateFileFromStream().
This function does not transfer ownership of file. Therefore, file must remain valid for the lifetime of this stream.
Note, the returned stream uses the “socketTimeoutMS” and “connectTimeoutMS” values from the MongoDB URI.
Some examples using this method:
MongoGridFSFileMBS.Read(ByteCount as Integer, MinBytes as Integer = -1) as String
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | MongoDB | MBS MongoDB Plugin | 25.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
MinBytes: The minimum number of bytes that must be read or an error will be synthesized.
This function performs a scattered read from file, potentially blocking to read from the MongoDB server.
MongoGridFSFileMBS.ReadAll as String
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | MongoDB | MBS MongoDB Plugin | 25.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This function performs a scattered read from file, potentially blocking to read from the MongoDB server.
MongoGridFSFileMBS.ReadAllMemory as MemoryBlock
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | MongoDB | MBS MongoDB Plugin | 25.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This function performs a scattered read from file, potentially blocking to read from the MongoDB server.
MongoGridFSFileMBS.ReadMemory(ByteCount as Integer, MinBytes as Integer = -1) as MemoryBlock
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | MongoDB | MBS MongoDB Plugin | 25.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
MinBytes: The minimum number of bytes that must be read or an error will be synthesized.
This function performs a scattered read from file, potentially blocking to read from the MongoDB server.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | MongoDB | MBS MongoDB Plugin | 25.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | MongoDB | MBS MongoDB Plugin | 25.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Modifying GridFS files is NOT thread-safe. Only one thread or process can access a GridFS file while it is being modified.
MongoGridFSFileMBS.Seek(delta as Int64, whence as Integer = 0)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | MongoDB | MBS MongoDB Plugin | 25.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The whence argument is interpreted as in fseek:
| SeekSet | Set the position relative to the start of the file. |
| SeekCurrent | Move delta relative to the current file position. |
| SeekEnd | Move delta relative to the end of the file. |
On success, the file’s underlying position pointer is set appropriately. On failure, the file position is NOT changed and an exception is raised.
MongoGridFSFileMBS.Write(Data as MemoryBlock) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | MongoDB | MBS MongoDB Plugin | 25.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Modifying GridFS files is NOT thread-safe. Only one thread or process can access a GridFS file while it is being modified.
Returns the number of bytes written.
See also:
MongoGridFSFileMBS.Write(Data as String) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | MongoDB | MBS MongoDB Plugin | 25.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Modifying GridFS files is NOT thread-safe. Only one thread or process can access a GridFS file while it is being modified.
Returns the number of bytes written.
See also:
The items on this page are in the following plugins: MBS MongoDB Plugin.