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