Home  |  Delphi .net Home  |  System.Buffer  |  ByteLength Method
  
ByteLength  
Method  
Gives the size of a primitive data array as a total of bytes
Buffer Class
System NameSpace
CF1.  Function ByteLength ( Buffer : Array of PrimitiveType ) : Integer; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
Mutiplies the array length by the PrimitiveType size, in bytes, to give the total array (buffer) size.
Notes
Static methods are not methods of an object - they are simply class functions or procedures available at any time.
Microsoft MSDN Links
System
System.Buffer
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

var
  buffer  : Array of Int64;
  buffLen : Integer;

begin
  // Set the array to be 5 elements of Int64's : 5 * 8 bytes = 40 total
  setLength(buffer, 5);
  buffLen := System.Buffer.ByteLength(buffer);
  Console.WriteLine('ByteLength = ' + buffLen.ToString);

  Console.ReadLine;
end.
   ByteLength = 40
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author