Skip to content

Modern Fs MemoryStream ToBytes

Paul Squires edited this page Oct 22, 2026 · 3 revisions

Home › Filesystem › File Streams › MemoryStream.ToBytes

MemoryStream.ToBytes

Copies every byte held into an Array; returns the count.

Syntax

MemoryStream.ToBytes( buf )

Notes

  • Replaces buf's contents with every byte held, whatever the position. Returns the count.

Examples

#import "std/fs"
#import "std/containers"
using fs

dim as MemoryStream m = MemoryStream( "abc" )
dim as containers.Array( of ubyte ) b
print m.ToBytes( b ), b[0]    '' 3 97

Library: Filesystem Library Category: File Streams Documented under: Streams

Clone this wiki locally