GSF.IO.BinaryStreamBase.ReadUInt8 C# (CSharp) Method

ReadUInt8() public method

Reads from the underlying stream in little endian format. Advancing the position.
public ReadUInt8 ( ) : byte
return byte
        public virtual byte ReadUInt8()
        {
            ReadAll(m_buffer, 0, 1);
            return m_buffer[0];
        }
        /// <summary>

Usage Example

 /// <summary>
 /// Loads the header.
 /// </summary>
 public void LoadHeader(BinaryStreamBase stream)
 {
     stream.Position = 0;
     byte version = stream.ReadUInt8();
     if (version == 109)
     {
         stream.Position = 0;
         if (EncodingDefinition.FixedSizeCombinedEncoding != new EncodingDefinition(stream.ReadGuid()))
             throw new Exception("Header Corrupt");
         if (TreeNodeType != new EncodingDefinition(stream.ReadGuid()))
             throw new Exception("Header Corrupt");
         if (BlockSize != stream.ReadInt32())
             throw new Exception("Header Corrupt");
         if (stream.ReadUInt8() != 0)
             throw new Exception("Header Corrupt");
         LastAllocatedBlock = stream.ReadUInt32();
         RootNodeIndexAddress = stream.ReadUInt32();
         RootNodeLevel = stream.ReadUInt8();
     }
     else if (version == 1)
     {
         if (BlockSize != stream.ReadInt32())
             throw new Exception("Header Corrupt");
         if (TreeNodeType != new EncodingDefinition(stream))
             throw new Exception("Header Corrupt");
         LastAllocatedBlock = stream.ReadUInt32();
         RootNodeIndexAddress = stream.ReadUInt32();
         RootNodeLevel = stream.ReadUInt8();
     }
     else
     {
         throw new VersionNotFoundException();
     }
 }
All Usage Examples Of GSF.IO.BinaryStreamBase::ReadUInt8