By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,238 Members | 1,485 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,238 IT Pros & Developers. It's quick & easy.

byte array concatenation

P: n/a
hi everyone,

This is prasad. I want to know how to concatenate two byte array
variables, can somebody help me.

thankx in advance.

Nov 17 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Prasad" <pr********@gmail.comschrieb:
This is prasad. I want to know how to concatenate two byte array
variables, can somebody help me.

Check out 'Buffer.BlockCopy'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 17 '06 #2

P: n/a
Dear Herfried K Wagner,

Thank you Herfried K Wagner for your reply, I'm new to this method can
u please give an example for Buffer.BlockCopy. Please Don't mind that
my question sounds silly. I'm learning vb.net, I'm creating a client
and server application. Wherein the image stored in mysql database is
fetched from server application and passed to client application. I use
winsock connection, here i'm facing a problem in sending the image blob
data as byte from Server -Client. I could able to see only half of
the image.

While tracing the program, the receiving function loops for 3 times. I
understood this is because the packet size handled here is large and so
it is being iterated for 3 times. So here i'm trying to concatenate the
byte array which is being executed for 3 times. Please suggest me an
efficient way to concatenate byte array.

Thanx in advance.

Nov 17 '06 #3

P: n/a
"Prasad" <pr********@gmail.comschrieb:
Thank you Herfried K Wagner for your reply, I'm new to this method can
u please give an example for Buffer.BlockCopy. Please Don't mind that
my question sounds silly. I'm learning vb.net
No problem -- check out the sample below:

\\\
Dim Data1() As Byte = {1, 2, 3, 4}
Dim Data2() As Byte = {5, 6, 7, 8}
Dim Data(Data1.Length + Data2.Length - 1) As Byte
Buffer.BlockCopy(Data1, 0, Data, 0, Data1.Length)
Buffer.BlockCopy(Data2, 0, Data, Data1.Length, Data2.Length)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 17 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.