ValidateHeader() публичный Метод

Determines whether the start of an array is a valid packet header.
public ValidateHeader ( byte header ) : bool
header byte The raw packet data to validate.
Результат bool
Пример #1
0
 /// <summary>
 /// Attempts to extract the length of a packet from its header.
 /// </summary>
 /// <remarks>
 /// When overriding this method in a derived class,
 /// do not call the base implementation.
 /// </remarks>
 /// <param name="header">The header byte array to process.</param>
 /// <param name="length">A variable to hold the result.</param>
 /// <returns><see langword="true"/> if the extraction was successful; otherwise, <see langword="false"/>.</returns>
 public bool TryGetLength(byte[] header, out int length)
 {
     if (_decryptor.ValidateHeader(header))
     {
         length = RollingIv.GetPacketLength(header);
         return(true);
     }
     else
     {
         length = default(int);
         return(false);
     }
 }