Platforms to show: All Mac Windows Linux Cross-Platform

Back to CFWriteStreamMBS class.

CFWriteStreamMBS.CanAcceptBytes as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Whether the stream can now accept data to write.

Whether the stream can currently be written to without blocking;
Returns TRUE if it's impossible to tell without trying.

CFWriteStreamMBS.close

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Closes the stream.

Terminates the flow of bytes; releases any system resources required by the stream. The stream may not fail to close.

CFWriteStreamMBS.CreateWithFile(fileurl as CFURLMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a new WriteStream using the given file specification.

Returns true if successfull.

CFWriteStreamMBS.CreateWithMemory as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a new memory based stream.

New buffers are allocated as bytes are written to the stream. At any point, you can recover the bytes thusfar written by asking for the property kCFStreamPropertyDataWritten (using GetProperty).

CFWriteStreamMBS.CreateWithMemoryBlock(mem as memoryblock, len as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a new WriteStream which writes the data into the given memoryblock.

The stream writes into the memoryblock given; when bufferCapacity is exhausted, the stream is exhausted (status becomes kCFStreamStatusAtEnd).
Returns nil on any error.

CFWriteStreamMBS.ErrorCode as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
The last error code.

Meaning depends on the ErrorDomain.

CFWriteStreamMBS.ErrorDomain as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
The error domain of the last error code.

Possible domains:
kCFStreamErrorDomainCustom = -1custom to the kind of stream in question
kCFStreamErrorDomainPOSIX = 1POSIX errno; interpret using <sys/errno.h>
kCFStreamErrorDomainMacOSStatus = 2OSStatus type from Carbon APIs; interpret using <MacTypes.h>

CFWriteStreamMBS.GetProperty(propertyName as CFStringMBS) as CFObjectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a property of the stream.

Returns nil on any error.
Particular streams can name properties and assign meanings to them; you access these properties through the GetProperty and SetProperty calls. A property is any interesting information about the stream other than the data being transmitted itself. Examples include the headers from an HTTP transmission, or the expected number of bytes, or permission information, etc. Properties that can be set configure the behavior of the stream, and may only be settable at particular times (like before the stream has been opened). See the documentation for particular properties to determine their get- and set-ability.

CFWriteStreamMBS.InstallEvents

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Installs the event handler.

You need to remove the event handler later to not leak memory!
The event handler is needed to have the Callback event fireing.

CFWriteStreamMBS.Open as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Opens the stream.

Returns success/failure. Opening a stream causes it to reserve all the system resources it requires. If the stream can open non-blocking, this will always return TRUE; listen to the Callback to find out when the open completes and whether it was successful, or poll using the Status property, waiting for a status of kCFStreamStatusOpen or kCFStreamStatusError.

CFWriteStreamMBS.RemoveEvents

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Removes the event handler.

You should remove this event handler after you finished with the stream.

CFWriteStreamMBS.SetProperty(propertyName as CFStringMBS, propertyValue as CFObjectMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets a property of the stream.

Returns true if successfull.

CFWriteStreamMBS.Status as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
The status of the stream.

Possible values:

kCFStreamStatusNotOpen = 0
kCFStreamStatusOpening = 1 (open is in-progress)
kCFStreamStatusOpen = 2
kCFStreamStatusReading = 3
kCFStreamStatusWriting = 4
kCFStreamStatusAtEnd = 5 (no further bytes can be read/written)
kCFStreamStatusClosed = 6
kCFStreamStatusError = 7

CFWriteStreamMBS.WriteMemory(mem as memoryblock, len as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Write the data from inside the memoryblock to the stream.

Returns the number of bytes successfully written, -1 if an error has occurred, or 0 if the stream has been filled to capacity (for fixed-length streams). If the stream is not full, this call will block until at least one byte is written. To avoid blocking, either poll via CanAcceptBytes or use the run loop and listen for the kCFStreamCanWrite event.

CFWriteStreamMBS.WriteString(buf as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation Network MBS MacCF Plugin 3.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Write the data from inside the string to the stream.

Returns the number of bytes successfully written, -1 if an error has occurred, or 0 if the stream has been filled to capacity (for fixed-length streams). If the stream is not full, this call will block until at least one byte is written. To avoid blocking, either poll via CanAcceptBytes or use the run loop and listen for the kCFStreamCanWrite event.

The items on this page are in the following plugins: MBS MacCF Plugin.


The biggest plugin in space...