473,500 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Moving from byte[] to byte[]


Which functions are available to move a part from byte[] into another byte[]
?
Let's say I have a byte[] of 20 and another of 40. And I want to move 5th to
15th from the first byte[] into occupping bytes 20 to 35 of the second
byte[].

Thanks in advance,

Nov 15 '05 #1
2 1950
Tim,
You can use either System.Buffer.BlockCopy or Array.Copy.

I understand that System.Buffer is optimized for primitive types, so it may
perform better than Array.Copy.

Hope this helps
Jay

"Tim Conner" <ti*******@hotmail.com> wrote in message
news:O%****************@TK2MSFTNGP09.phx.gbl...

Which functions are available to move a part from byte[] into another byte[] ?
Let's say I have a byte[] of 20 and another of 40. And I want to move 5th to 15th from the first byte[] into occupping bytes 20 to 35 of the second
byte[].

Thanks in advance,


Nov 15 '05 #2
Tim Conner wrote:
Which functions are available to move a part from byte[] into another byte[]
?
Let's say I have a byte[] of 20 and another of 40. And I want to move 5th to
15th from the first byte[] into occupping bytes 20 to 35 of the second
byte[].

System.Array.Copy is the answer.

E.g.:
Array.Copy(sourceArray, 5, DestinationArray, 20, 16);

- Dario

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1912
by: HeroOfSpielburg | last post by:
hi, I know this is a much-travelled subject, but I was wondering what people's thoughts were on the bare minimum (and conversely the grand scheme) for augmenting standard memory references to...
11
2462
by: ulyses | last post by:
Let's assume I have following file: 2938929384902491233..... 923949919199191919112.... File contains INTs only. What is more they are huge. For example first row in file may contain integer...
1
1982
by: Ilya N. Golubev | last post by:
There is already one function processing pointer values this way. And there may easily appear more, including wrappers for this function. For purposes of further discussion, consider simplified...
4
1650
by: Rafael Tejera | last post by:
I'm moving some code from my old pc. I'm using VS NET 2003 C# and MSSQL 2003. Everything is in place, but I'm receiving this error messages. thansk for you help... Here is the error...
0
1638
by: linkswanted | last post by:
http://www.movingcompanies.co.il/supplies/boxes.html http://www.movingcompanies.co.il/residental/ http://www.movingcompanies.co.il/commercial/corporate-moves.html...
0
1828
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
0
1763
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
10
3891
by: Alessio Sangalli | last post by:
Hi, I am facing some performance issues in an algorithm to "translate" some YUV data in another format. I'll make everything very simple: I have 4 blocks of Y data, one of U data and one of V...
2
2376
by: K Viltersten | last post by:
I've found a couple of examples for moving a file on a FTP server to another location but all of them required something like this. char command = "PASV\r\n".ToCharArray(); Byte cmd =...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.