Difference between revisions of "Xojo.Core.MemoryBlock.Constructor(bytes() As Byte)"

From Xojo Documentation

(Created page with "{{ConstructorBox | name=Constructor | owner=Xojo.Core.MemoryBlock | ownertype=class | scope=public | parameters=bytes() As Byte }} {{Description | text = Creates a Mem...")
 
 
Line 17: Line 17:
 
== Sample Code ==
 
== Sample Code ==
 
<rbcode>
 
<rbcode>
Dim bytes() As Byte
+
Var bytes() As Byte
bytes.Append(&hff)
+
bytes.AddRow(&hff)
bytes.Append(&hff)
+
bytes.AddRow(&hff)
bytes.Append(&hff)
+
bytes.AddRow(&hff)
  
Dim b As New Xojo.Core.MemoryBlock(bytes)
+
Var b As New Xojo.Core.MemoryBlock(bytes)
 
</rbcode>
 
</rbcode>

Latest revision as of 17:28, 11 August 2019

Constructor

Xojo.Core.MemoryBlock.Constructor(bytes() As Byte)

Creates a MemoryBlock from an existing Byte array.

Notes

The contents of the Byte array are copied into the MemoryBlock. Mutating the MemoryBlock has no effect on the original array.

Exceptions

Sample Code

Var bytes() As Byte
bytes.AddRow(&hff)
bytes.AddRow(&hff)
bytes.AddRow(&hff)

Var b As New Xojo.Core.MemoryBlock(bytes)