hi, i have a structure wid a byte array member
[code=c]
public struct pack
{ public byte[] data;
/*...*/
}[/code]
and i have an array of packets
the following code works fine:
[code=cpp]
FileStream inStream = File.OpenRead(" some file name");
FileStream outStream = File.OpenWrite( "some filename");
int bytesRead;
byte[] buf = new byte[4096];
int num_pac=0;
while ((bytesRead = inStream.Read(b uf, 0, 4096)) > 0)
{ pkt[i].data=buf;
outStream.Write (pkt[i].data, 0, 4096);
num_pac++;
}
[/code]
however when i write the file seperately i get the followin error
[code=cpp]
for(int j=0;j<num_pac;j ++)
{ outStream.Write (pkt[j].data, 0, 4096);}
[/code]
can someone suggest a solution?
thanks in advance
[code=c]
public struct pack
{ public byte[] data;
/*...*/
}[/code]
and i have an array of packets
the following code works fine:
[code=cpp]
FileStream inStream = File.OpenRead(" some file name");
FileStream outStream = File.OpenWrite( "some filename");
int bytesRead;
byte[] buf = new byte[4096];
int num_pac=0;
while ((bytesRead = inStream.Read(b uf, 0, 4096)) > 0)
{ pkt[i].data=buf;
outStream.Write (pkt[i].data, 0, 4096);
num_pac++;
}
[/code]
however when i write the file seperately i get the followin error
[code=cpp]
for(int j=0;j<num_pac;j ++)
{ outStream.Write (pkt[j].data, 0, 4096);}
[/code]
can someone suggest a solution?
thanks in advance
Comment