Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subset of byte array
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Subset of byte array
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01131283
Message ID:
01131283
Views:
61
My guess is that something like this must exist in the framework but I can't find it where I expect it to be:)
I would like a function to return a subset of a byte array (similar to what Substring() does for a string).

Something like this:
byte[] ba = new byte[100];
byte[] subba = ba.Subbytearray(3, 10); // starting at index 3 and returning 10 elements
Since I can't find Subbytearray, I use the following code:
byte[] ba = new byte[100];
byte[] subba = new byte[100];
subba = Array.Copy(ba, 3, subba, 0, 10);
Thanks,
Einar
Semper ubi sub ubi.
Reply
Map
View

Click here to load this message in the networking platform