Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subset of byte array
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Subset of byte array
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01131283
Message ID:
01131283
Vues:
62
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.
Répondre
Fil
Voir

Click here to load this message in the networking platform