BinaryStream.Close
From Xojo Documentation
Method
Closes the stream (and hence the file opened by the stream).
Sample Code
This code backs a BinaryStream with a MemoryBlock that is declared 0-sized:
Var mb As New MemoryBlock(0)
Var bs As New BinaryStream(mb)
bs.WriteLong(4)
bs.WriteDouble(3.14)
bs.Close
MessageBox(mb.Long(0).ToString)
Var bs As New BinaryStream(mb)
bs.WriteLong(4)
bs.WriteDouble(3.14)
bs.Close
MessageBox(mb.Long(0).ToString)
Note that Close was called after the write. It is critical that you call Close after the back or the size of the MemoryBlock is likely to be wrong.