Re: MemoryStream.Write() Offset cannot be zero
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Wed, 8 Jun 2005 07:21:37 +0100
Gravity <gravity@xxxxxxxxxx> wrote:
> I see... I think I might have some missunderstanding here. I have always
> compare to C/C++ -> memcpy( )
>
> If I am writting 5 parameter of int32 which each consist of 4 bytes into it.
>
> Does it mean the code should look like;
>
> MemoryStream.Write(paramA, 0, 4);
> MemoryStream.Write(paramB, 0, 4);
>
> MemoryStream.Write(paramC, 0, 4);
>
> MemoryStream.Write(paramD, 0, 4);
>
> MemoryStream.Write(paramE, 0, 4);
>
> where the write operation will be performed will automatically increased to
> the next location?
Absolutely. It's a *stream*, not an array. Imagine you were writing to
a file - it's just like that, except it all stays in memory.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.
- Follow-Ups:
- Re: MemoryStream.Write() Offset cannot be zero
- From: Gravity
- Re: MemoryStream.Write() Offset cannot be zero
- References:
- MemoryStream.Write() Offset cannot be zero
- From: Gravity
- Re: MemoryStream.Write() Offset cannot be zero
- From: mdb
- Re: MemoryStream.Write() Offset cannot be zero
- From: Gravity
- MemoryStream.Write() Offset cannot be zero
- Prev by Date: Re: Window class name
- Next by Date: Re: framework redistributable vs languages
- Previous by thread: Re: MemoryStream.Write() Offset cannot be zero
- Next by thread: Re: MemoryStream.Write() Offset cannot be zero
- Index(es):
Relevant Pages
|
Loading