public UInt32 ReadUInt32()
{
byte[] data;
try {
data = _reader.ReadBytes(4);
if (data.Length != 4) {
throw new EndOfStreamException();
}
} catch (Exception) {
throw new AlertException(AlertDescription.IllegalParameter,
"Error reading UInt24 in HandshakeStream");
}
if (BitConverter.IsLittleEndian) {
Array.Reverse(data);
}
return BitConverter.ToUInt32(data, 0);
}