任意の長さの byte[] 配列があり、それを部分に分割したいのですが、各部分の長さは 2205 で、それらの 2205 バイトに対して操作を行う必要があります。これが私のアルゴリズムです。
// SPLIT BY 2205 Bytes
int block = 2205;
int counter = 0;
byte[] to_Send = new byte[block];
foreach (byte b in ARCHIEVE_BUFFER)
{
if (counter < 2205)
{
to_Send[counter] = b;
counter++;
}
else if (counter == 2205)
{
// do some operation on those 2205 bytes which stored on the array to_send
counter = 0;
to_Send[counter] = b;
counter++;
}
}
配列を固定数の範囲に分割したいだけです