Buffer.ByteLength(byteArray) বাইট অ্যারের মোট বাইট সংখ্যা রিটার্ন করে (যা Length-এর সমান)।
উদাহরণ
using System;
class Program {
static void Main() {
byte[] arr = { 5, 9, 19, 23, 29, 35, 55, 78 };
int len = Buffer.ByteLength(arr);
Console.WriteLine("Length: " + len); // 8
foreach (byte b in arr) Console.WriteLine(b);
}
}
আউটপুট
Length: 8 5 9 19 23 29 35 55 78