Denis,
Do you want the bData array itself to be modified by SomeClass, or does
SomeClass need a copy of the data?
You can use Array.Copy if SomeClass only needs a copy of the data.
If SomeClass needs a reference to the data you have two choices.
1. pass the array, index & length to SomeClass itself, and let SomeClass
handle the indexing into the original array.
2. Create an Array Proxy that you pass the array, index & length to.
SomeClass would accept the ArrayProxy as a parameter. The array Proxy would
handle the indexing into the original array.
Seeing as an array is an object on the heap, you automatically get the
reference in both cases.
In either case you can offer overloads for index & length, following how the
framework does it:
void MyFunction(Array array)
void MyFunction(Array array, int length)
void MyFunction(Array array, int index, int length)
Where index would default to 0, and length would default to the length of
the array.
Hope this helps
Jay
"Denis C" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
Hi
I have a byte array of length 2404. I want to access
subsets of the array and pass the subset to the
constructor of a class.
i.e.
Dim bData(2403) As Byte
Dim aThing As SomeClass = new SomeClass(bData(12..211))
where bData(12..211) passes bytes 12 to 211 from bData.
Is there some way of doing this?
Denis