Recently i used a dll file which needed array of bytes for input
i got 512000 bytes in this way:

ReDim buffer(512000) As Byte

and gave it to .dll file .
but .dll file only used some of it for example 200000 byte.
everytime .dll file use different space so how much it use my array is unknown.
how can i free extra memory from end of my array??
i copied my array to a string and use Rtim for it but it didnt work.

plz help
thanks anyway!!!