private void ReadArrayAsBytes(ParseRecord pr)
{
if (pr.PRarrayElementTypeCode == InternalPrimitiveTypeE.Byte)
{
pr.PRnewObj = (object)this.ReadBytes(pr.PRlengthA[0]);
}
else if (pr.PRarrayElementTypeCode == InternalPrimitiveTypeE.Char)
{
pr.PRnewObj = (object)this.ReadChars(pr.PRlengthA[0]);
}
else
{
int num1 = Converter.TypeLength(pr.PRarrayElementTypeCode);
pr.PRnewObj = (object)Converter.CreatePrimitiveArray(pr.PRarrayElementTypeCode, pr.PRlengthA[0]);
Array dst = (Array)pr.PRnewObj;
int num2 = 0;
if (this.byteBuffer == null)
{
this.byteBuffer = new byte[4096];
}
while (num2 < dst.Length)
{
int num3 = Math.Min(4096 / num1, dst.Length - num2);
int num4 = num3 * num1;
this.ReadBytes(this.byteBuffer, 0, num4);
Buffer.InternalBlockCopy((Array)this.byteBuffer, 0, dst, num2 * num1, num4);
num2 += num3;
}
}
}